convertZonedToZoned
Signature
Section titled “Signature”convertZonedToZoned(value: string, timeZone: string): stringConvert a zoned ISO 8601 datetime string to the same instant in a different timeZone.
- Uses Temporal.ZonedDateTime.withTimeZone to convert.
- Returns "" for invalid input.
- An offset with seconds (
-00:44:30) returns"". A written zone cannot carry seconds (RFC 9557 §4.1), so the result could not name it. Pass the IANA name, or callfromOffsetInstant({ instant, offset })for the local time with its full offset and no bracket.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
value | string | zoned ISO 8601 datetime string |
timeZone | string | target IANA name or a UTC offset to the minute (what isValidTimeZone accepts) |
Returns
Section titled “Returns”zoned ISO 8601 string in target timeZone or "" when invalid
Examples
Section titled “Examples”import { convertZonedToZoned } from "@northguild/gmt/zoned/convert";
convertZonedToZoned("2024-02-29T12:34:56.789+00:00[UTC]", "Asia/Kolkata") // "2024-02-29T18:04:56.789+05:30[Asia/Kolkata]"Converter + format bench
Section titled “Converter + format bench”Source
Section titled “Source”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.