UNPKG

@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.

15 lines • 659 B
/** * Return the current day of week for the specified IANA timeZone. * * - Uses nowZonedDateTimeISO() to get the current time. * - Returns 1-7 (Monday=1 through Sunday=7). * - Validation is performed on the 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 current day of week number (1-7) or null on invalid input * * @example getZonedDayOfWeek("Australia/Sydney") // 5 * @example getZonedDayOfWeek("invalid") // null */ export declare function getZonedDayOfWeek(ianaTimezone: string): number | null;