Skip to content

getZonedNanosecond

getZonedNanosecond(ianaTimezone: string): string
import { getZonedNanosecond } from "@northguild/gmt/zoned/get";

Return the current nanosecond for the specified IANA timeZone.

  • Uses Temporal.Now.zonedDateTimeISO to get the current time.
  • Validation is performed on the timezone.
Parameter Type Description
ianaTimezone string IANA timeZone identifier

current nanosecond string (zero-padded to 3 digits) or “” on invalid input

getZonedNanosecond("America/New_York") // "000"
getZonedNanosecond("invalid") // ""

zoned/get/getZonedNanosecond.ts