Skip to content

getZonedDayOfWeek

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

Return 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.
Parameter Type Description
ianaTimezone string IANA timeZone identifier

current day of week number (1-7) or null on invalid input

getZonedDayOfWeek("America/New_York") // 3
getZonedDayOfWeek("invalid") // null

zoned/get/getZonedDayOfWeek.ts