parseTimeZoneFromZoned
Signature
Section titled “Signature”parseTimeZoneFromZoned(value: string): stringExtract the IANA timeZone identifier from an ISO 8601 zoned datetime string.
- Extracts timeZone id from a ZonedDateTime.
- Returns "" for invalid input.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
value | string | zoned ISO 8601 datetime string |
Returns
Section titled “Returns”IANA timeZone id or "" when invalid
Examples
Section titled “Examples”import { parseTimeZoneFromZoned } from "@northguild/gmt/zoned/parse";
parseTimeZoneFromZoned("2024-02-29T12:34:56.789+00:00[UTC]") // "UTC"