Skip to content

convertUtcToZoned

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

Convert a UTC Instant string to a zoned ISO 8601 datetime string.

  • Uses Temporal.Instant.from to parse, converts to specified timezone.
  • Validates both UTC input and timezone.
  • 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 call fromOffsetInstant({ instant, offset }) for the local time with its full offset and no bracket.
ParameterTypeDescription
valuestringUTC Instant string
timeZonestringIANA name or a UTC offset to the minute (what isValidTimeZone accepts)

zoned ISO 8601 string or "" on invalid

import { convertUtcToZoned } from "@northguild/gmt/utc/convert";
convertUtcToZoned("2024-02-29T00:00:00Z", "Australia/Sydney") // "2024-02-29T11:00:00+11:00[Australia/Sydney]"
output 

utc/convert/convertUtcToZoned.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.