Skip to content

getZonedToday

getZonedToday(ianaTimezone: string): string

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.
ParameterTypeDescription
ianaTimezonestringIANA name or UTC offset: a time zone identifier (+05:30, +0530, -08) or a stored offset (±HH:MM[:SS], what getTimeZoneOffset returns)

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

import { getZonedToday } from "@northguild/gmt/zoned/get";
getZonedToday("America/New_York") // "2024-02-29"
output 

zoned/get/getZonedToday.ts