Skip to content

getZonedNow

  • The core functions, which every industry uses.
getZonedNow(ianaTimezone: string, optionsArg?: { smallestUnit?: PluralizeUnit<"minute" | "second" | "millisecond" | "microsecond" | "nanosecond"> | undefined; }): string

Return the current zoned datetime for the specified IANA timeZone.

  • Uses Temporal.Now.zonedDateTimeISO() to get the current time.
  • Validation is performed on the timezone.
  • smallestUnit is the only option read. Any other key on optionsArg is ignored, so the string always carries the offset and the bracketed time zone, and smaller units are always truncated.
  • 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
ianaTimezonestringIANA name or a UTC offset to the minute (what isValidTimeZone accepts)

optionsArg

optional setting for the precision of the output string

OptionTypeDefaultDescription
smallestUnit?PluralizeUnit<"minute" | "second" | "millisecond" | "microsecond" | "nanosecond">"millisecond"The smallest unit written in the output string, from "minute" to "nanosecond", singular or plural. Anything smaller is truncated, as Temporal’s toString does with its "trunc" rounding mode.

zoned ISO 8601 datetime string or "" on invalid input

import { getZonedNow } from "@northguild/gmt/zoned/get";
getZonedNow("Asia/Tokyo") // "2024-02-29T23:30:45.123+09:00[Asia/Tokyo]"
output 

zoned/get/getZonedNow.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.