Skip to content

hasDaylightSaving

hasDaylightSaving(timeZone: string): boolean
import { hasDaylightSaving } from "@northguild/gmt/zoned/validate";

Check whether an IANA timeZone identifier observes daylight saving time.

  • Compares UTC offsets at two dates six months apart (January and July).
  • A zone is considered to have DST if its offset differs between the two dates.
  • Returns false for invalid or unresolvable timeZone identifiers.
Parameter Type Description
timeZone string timeZone identifier to check

boolean indicating whether the timeZone observes DST

hasDaylightSaving("America/New_York") // true
hasDaylightSaving("Europe/Berlin") // true
hasDaylightSaving("Asia/Tokyo") // false
hasDaylightSaving("UTC") // false
hasDaylightSaving("Invalid/Zone") // false

zoned/validate/hasDaylightSaving.ts