# parseYearMonthFromDate

:::caution[Unreleased]
Not in `@northguild/gmt` 1.20.0 on npm yet. It is on `main` and ships in the next release.
:::

## Signature

```ts
parseYearMonthFromDate(value: string): string
```

Return the year-month (`YYYY-MM`) of an ISO 8601 date string.

- The day is dropped, so `2026-10-01` and `2026-10-31` give the same year-month.
- Only the ISO calendar is read; a Hebrew or Islamic date gives `""`.
- Returns "" for invalid input.

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| `value` | `string` | ISO date string |

## Returns

The canonical `YYYY-MM` string (`±YYYYYY-MM` outside 0000-9999), or "" on invalid input

## Examples

```ts
import { parseYearMonthFromDate } from "@northguild/gmt/plain/parse";

parseYearMonthFromDate("2026-10-01") // "2026-10"
```

## Source

[plain/parse/parseYearMonthFromDate.ts](https://github.com/northguild/gmt/blob/main/packages/gmt/src/plain/parse/parseYearMonthFromDate.ts)
