getZonedDayOfWeek
Signature
Section titled “Signature”getZonedDayOfWeek(ianaTimezone: string): number | nullReturn the current day of week for the specified IANA timeZone.
- Uses Temporal.Now.zonedDateTimeISO to get the current time.
- Returns 1-7 (Monday=1 through Sunday=7).
- Validation is performed on the timezone.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
ianaTimezone | string | IANA name or UTC offset: a time zone identifier (+05:30, +0530, -08) or a stored offset (±HH:MM[:SS], what getTimeZoneOffset returns) |
Returns
Section titled “Returns”current day of week number (1-7) or null on invalid input
Examples
Section titled “Examples”import { getZonedDayOfWeek } from "@northguild/gmt/zoned/get";
getZonedDayOfWeek("America/New_York") // 3