# parseNotamValidity

Industry: Aviation

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

## Signature

```ts
parseNotamValidity(value: string, options: TwoDigitYearOptions): NotamValidity | null
```

Parse a NOTAM item B) or C) value as a UTC instant, an estimate, or a permanent validity.

- **What it reads.** The ten-digit date-time group `YYMMDDHHMM` in UTC (item B and item C), the same group followed by `EST` with no space (item C), or `PERM` (item C). One group at a time: no `B)`/`C)` label, no whitespace.
- **`PERM` is a state.** Permanent validity has no end, so it is `{ kind: "permanent" }` and not a far-future date. It still needs `options.yearWindow`: a call without a window is malformed, found on the first value and not on the first dated one.
- **`EST` keeps its instant.** `estimated: true` marks the time as an estimate (the NOTAM is later replaced or cancelled), not an end.
- **The century is the caller's.** `options.yearWindow` places `YY` in a hundred-year window: a fixed first year, for stored NOTAMs, or `"rolling"`, for a live feed. Without `yearWindow` the result is `null`.
- **Nothing is corrected.** `2400`, `WIE` and `UFN` return `null`; OPADD gives those fixes to a NOTAM Processing Unit, not to a reader. A month, day, hour or minute that does not exist returns `null`.
- **UTC in and out.** Both are UTC by the standard, so no local wall time is resolved and no disambiguation policy applies.
- **Sources.** ICAO PANS-AIM (Doc 10066), Appendix 3 §5 and §6: the ten-figure group in UTC, `0000`, `2359` and not `2400`, `EST`, `PERM`, and the later cancellation or replacement of an `EST` NOTAM. EUROCONTROL-GUID-121, _OPADD_ Ed. 4.1, as the multinational peer, for what ICAO does not say: no space before `EST` and no `WIE`, `WEF`, `UFN` or `APRX DUR` (§2.3.16, §2.3.17), and the corrections a NOTAM Processing Unit makes (Ch. 3).

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| `value` | `string` | A NOTAM item B) or C) value (e.g. "2506151200", "1407031230EST", "PERM") |

## Options

**options**

The hundred-year window a two-digit year is read in

Type: [`TwoDigitYearOptions`](/gmt/reference/types/TwoDigitYearOptions/).

| Option | Type | Default | Description |
| --- | --- | --- | --- |
| `yearWindow?` | `number` \| `"rolling"` | None. A value with a two-digit year returns the sentinel: no standard says which century it belongs to, so the caller states it. | The hundred-year window a two-digit year falls in. A number is the first year of a fixed window, an integer from 0 to 9900: `2000` reads `00`–`99` as 2000–2099; `1950` reads `50`–`99` as 1950–1999 and `00`–`49` as 2000–2049. A fixed window gives the same answer in any year, so it is the form for stored data, archives and anything re-processed later. `"rolling"` is the hundred years around today: from 50 years before the current UTC calendar year to 49 years after it (in 2026, 1976–2075). It is the form for live messages and never needs maintenance, but it gives a different answer for the same stored value as years pass. Any other value returns the function's sentinel. |

## Returns

the validity (&#123; kind: "instant", instant, estimated &#125; or &#123; kind: "permanent" &#125;), or null on invalid input

## Types

### NotamValidity

A NOTAM validity value: item B) (when the NOTAM comes into force) or item C) (when it ceases), as read by `parseNotamValidity`. ICAO PANS-AIM (Doc 10066), Appendix 3 §5 and §6; EUROCONTROL-GUID-121, _OPADD_ Ed. 4.1, §2.3.16 and §2.3.17, as the multinational peer.

```ts
import type { NotamValidity } from "@northguild/gmt";
```

```ts
type NotamValidity =
  /** A ten-digit date-time group `YYMMDDHHMM`, with or without `EST`. */
  | {
      /** Always `"instant"`. */
      kind: "instant";
      /** The group as UTC, ISO 8601 ending in `Z`, seconds written (`2025-06-15T12:00:00Z`). */
      instant: string;
      /**
       * `true` when item C) carried `EST`. PANS-AIM App 3 §6: "If the information on timing is
       * uncertain, the approximate duration shall be indicated using a date-time group followed
       * by the abbreviation 'EST'. Any NOTAM which includes an 'EST' shall be cancelled or
       * replaced before the date-time specified in Item C)". The time is an estimate, not an end.
       */
      estimated: boolean;
    }
  /**
   * Item C) `PERM`: "the information is of a permanent nature" (PANS-AIM App 3 §6). It carries
   * no instant, on purpose: it has no end to compare against.
   */
  | {
      /** Always `"permanent"`. */
      kind: "permanent";
    };
```

## Related types

- [`TwoDigitYearOptions`](/gmt/reference/types/TwoDigitYearOptions/)

## Examples

```ts
import { parseNotamValidity } from "@northguild/gmt/aviation/parse";

parseNotamValidity("2506151200", { yearWindow: 2000 }) // { kind: "instant", instant: "2025-06-15T12:00:00Z", estimated: false }
```

## Source

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