Skip to content

getZonedSecond

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

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

getZonedSecond("America/New_York") // "00"
getZonedSecond("invalid") // ""

zoned/get/getZonedSecond.ts