[tz] Canonica and non-canonical timezone question
Paul Eggert
eggert at cs.ucla.edu
Tue Aug 30 15:46:30 UTC 2022
On 8/29/22 03:54, Andriy Hromyak via tz wrote:
> https://github.com/moment/moment-timezone/issues/828#issuecomment-1228548097
>
> could you please assist on providing info on how we can distinguish
> canonical and non-canonical timezones.
"Canonical timezones" is not a phrase we use, so I'm not sure what
exactly is being asked for.
In general, if you stick with the timezone names listed in
zone1970.tab's column 3 you should be OK:
https://github.com/eggert/tz/blob/main/zone1970.tab
For moment-timezone in particular, you can find currently-supported
timezone names by looking at the source code for whatever version of
moment-timezone you're relying on. Here's a reference to the current
version with its full data:
https://momentjs.com/downloads/moment-timezone-with-data.js
As you probably know, moment-timezone is in legacy mode. If your app is
still being developed I suggest switching to a replacement for
moment.js, such as date-fns or dayjs. With a good replacement you should
be able to simply ask your JavaScript platform by using
Intl.supportedValuesOf('timeZone'), though you may need a polyfill for
older browsers.
If you want a platform-independent list of names, zone1970.tab is
probably your best bet.
More information about the tz
mailing list