Skip to main content

Function: isValidTimezone()

function isValidTimezone(tz: string): boolean;

Defined in: lib/util.ts:227

Returns true when tz is a valid IANA timezone string accepted by the Intl API. Some Linux systems expose TZ=:/etc/localtime which Chrome resolves to "Etc/Unknown" — an identifier that Node accepts but browsers reject with a RangeError.

Parameters​

ParameterType
tzstring

Returns​

boolean