@northguild/gmt
Version:
Date and time library for JavaScript and TypeScript, built on TC39 Temporal: time zones, DST, business days, ISO 8601 strings in and out. Never throws.
14 lines • 595 B
TypeScript
/**
* Return today's date in the given IANA timeZone as an ISO date string.
*
* - Uses nowZonedDateTimeISO() to get current date in timezone.
* - Returns "" for invalid timezone.
*
* @param ianaTimezone IANA name or UTC offset: a time zone identifier (`+05:30`, `+0530`, `-08`) or
* a stored offset (`±HH:MM[:SS]`, what `getTimeZoneOffset` returns)
* @returns ISO date string (YYYY-MM-DD) or "" when invalid
*
* @example getZonedToday("Asia/Kolkata") // "2024-02-29"
* @example getZonedToday("invalid") // ""
*/
export declare function getZonedToday(ianaTimezone: string): string;