Skip to content

getZonedMillisecond

getZonedMillisecond(ianaTimezone: string): string

Return the current millisecond for the specified IANA timeZone.

  • Uses Temporal.Now.zonedDateTimeISO to get the current time.
  • Validation is performed on the timezone.
ParameterTypeDescription
ianaTimezonestringIANA name or UTC offset: a time zone identifier (+05:30, +0530, -08) or a stored offset (±HH:MM[:SS], what getTimeZoneOffset returns)

current millisecond string (zero-padded to 3 digits) or "" on invalid input

import { getZonedMillisecond } from "@northguild/gmt/zoned/get";
getZonedMillisecond("America/New_York") // "000"
output 

zoned/get/getZonedMillisecond.ts