Skip to content

getZonedToday

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

Return today’s date in the given IANA timeZone as an ISO date string.

  • Uses Temporal.Now.zonedDateTimeISO to get current date in timezone.
  • Returns “” for invalid timezone.
Parameter Type Description
ianaTimezone string IANA timeZone identifier

ISO date string (YYYY-MM-DD) or “” when invalid

getZonedToday("America/New_York") // "2024-02-29"
getZonedToday("invalid") // ""

zoned/get/getZonedToday.ts