Intl.supportedValuesOf('timezone') doesn't provide the latest timezone information

301 views Asked by At

I want to obtain the most up-to-date timezone list. I'm using Intl.supportedValuesOf('timeZone'), and here's the output, for instance:

  • 'Asia/Saigon'
  • 'Pacific/Ponape'

The cities mentioned above have been deprecated. For example, when I researched the 'Asia/Saigon' timezone, I found that it has been renamed to 'Asia/Ho_Chi_Minh', and 'Pacific/Ponape' no longer exists as a valid timezone.

I'm curious about why Intl.supportedValuesOf('timeZone') doesn't provide the latest timezone information.

Is there an alternative method to obtain the most current timezone list? Thank you.

1

There are 1 answers

8
Matt Johnson-Pint On

I believe this is a known bug. Some links to issues: here, here, and here. Probably others.

The cause is that the list comes from an ICU function call, which is returning only the "canonical" zones (according to ICU/CLDR, not IANA), excluding aliases, and also excluding the system (Etc/*) zones.

In other words, this is an implementation bug in V8 and other JS engines, not a bug with JavaScript itself.