Skip to content

getZonedMonth

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

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

getZonedMonth("America/New_York") // "02"
getZonedMonth("invalid") // ""

zoned/get/getZonedMonth.ts