@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.
13 lines • 590 B
TypeScript
/**
* Return the runtime system timeZone name (for example "Europe/London").
*
* - 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.
*
* @returns system timeZone name or "" on failure
*
* @example getSystemTimeZone() // "Europe/London"
*/
export declare function getSystemTimeZone(): string;