# getZonedYear

Industry: Core

## Signature

```ts
getZonedYear(ianaTimezone: string): string
```

Return the current year for the specified IANA timeZone.

- Uses Temporal.Now.zonedDateTimeISO() to get the current time.
- Validation is performed on the timezone.
- The year is zero-padded to 4 digits. A year outside 0000–9999 is written with a sign and six digits (`+010000`, `-000005`), as Temporal writes it at the head of a date.

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| `ianaTimezone` | `string` | IANA name or UTC offset: a time zone identifier (`+05:30`, `+0530`, `-08`) or a stored offset (`±HH:MM[:SS]`, what `getTimeZoneOffset` returns) |

## Returns

current year string (zero-padded to 4 digits) or "" on invalid input

## Examples

```ts
import { getZonedYear } from "@northguild/gmt/zoned/get";

getZonedYear("Africa/Johannesburg") // "2024"
```

## Source

[zoned/get/getZonedYear.ts](https://github.com/northguild/gmt/blob/main/packages/gmt/src/zoned/get/getZonedYear.ts)
