@northguild/gmt
Version:
Date and time library for JavaScript and TypeScript, built on TC39 Temporal: time zones, DST, business days, ISO 8601 strings in and out. Never throws.
13 lines • 479 B
TypeScript
/**
* Extract the IANA timeZone identifier from an ISO 8601 zoned datetime string.
*
* - Extracts timeZone id from a ZonedDateTime.
* - Returns "" for invalid input.
*
* @param value zoned ISO 8601 datetime string
* @returns IANA timeZone id or "" when invalid
*
* @example parseTimeZoneFromZoned("2024-02-29T12:34:56.789+00:00[UTC]") // "UTC"
* @example parseTimeZoneFromZoned("invalid") // ""
*/
export declare function parseTimeZoneFromZoned(value: string): string;