Skip to content

getZonedMillisecond

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

Return the current millisecond 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 millisecond string (zero-padded to 3 digits) or “” on invalid input

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

zoned/get/getZonedMillisecond.ts