Skip to content

listTimezones

Returns the list of IANA timezone identifiers supported by the runtime.

Wraps Intl.supportedValuesOf('timeZone') which is available in Node 18+, Chrome 93+, Firefox 93+, Safari 15.4+.

Available since v2.0.0

import { listTimezones } from '@helpers4/date';
// or, from the all-in-one package (same code, one install):
import { listTimezones } from 'helpers4/date';
listTimezones(): string[]

string[] — An array of IANA timezone strings (e.g. ['Africa/Abidjan', …, 'US/Pacific'])

listTimezones() // => ['Africa/Abidjan', 'Africa/Accra', …]

Options for formatInTimezone.

interface FormatInTimezoneOptions {
  formatOptions?: DateTimeFormatOptions;
  locale?: string;
}

View source on GitHub