Skip to content

parseYearFromZoned

  • The core functions, which every industry uses.
parseYearFromZoned(value: string): string

Return the year for a given ISO 8601 zoned datetime string.

  • Returns the year as Temporal writes it: four digits ("2024", "0005"), or a sign and six digits outside 0000–9999 ("+010000", "-000005").
  • Returns "" for invalid input.
ParameterTypeDescription
valuestringISO zoned datetime string

the year as four digits, or a sign and six digits outside 0000–9999, or "" on invalid input

import { parseYearFromZoned } from "@northguild/gmt/zoned/parse";
parseYearFromZoned("2024-03-15T14:30:45.123+00:00[UTC]") // "2024"
output 

zoned/parse/parseYearFromZoned.ts

Accessibility
© 2026 NorthGuild · Licences

Code examples: MIT-0. Packages: MIT. Third-party data and components: their own licences, credited where they appear. Everything else: © 2026 NorthGuild, all rights reserved.