Skip to content

getZonedSecond

getZonedSecond(ianaTimezone: string): string

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

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

zoned/get/getZonedSecond.ts