Skip to content

getSystemTimeZone

getSystemTimeZone(): string

Return the runtime system timeZone name (for example “America/New_York”).

  • Uses Intl.DateTimeFormat().resolvedOptions().timeZone to get system timezone.
  • Returns "" when the host reports no usable time zone. With an empty TZ the runtime reports ICU’s placeholder "Etc/Unknown", and with an unrecognised TZ it reports undefined; neither is a zone that Temporal or Intl.DateTimeFormat accepts.

system timeZone name or "" on failure

import { getSystemTimeZone } from "@northguild/gmt/zoned/get";
getSystemTimeZone() // "America/New_York"
output 

zoned/get/getSystemTimeZone.ts