0
Intl.supportedValuesOf('timeZone')

Above code will give list of all time zone in en-US like below

["Africa/Abidjan", "Africa/Accra" , "Africa/Addis_Ababa", ...]

Is there way to get list of all time zone in desire language.

asked Apr 16, 2025 at 12:05
1
  • 5
    Those names are identifiers, not localized names. Commented Apr 16, 2025 at 13:25

1 Answer 1

1

Above code will give list of all time zone in en-US

It looked like you think en-US (the locale) would select the time zone identifiers for that locale.

locale and timeZone are not related. You can for example format a date in the locale en-US for timeZone Asia/Shanghai.

const myDate = new Date(`2000年01月01日`);
console.log(
 [myDate.toLocaleString(`en-US`, {timeZone: `Asia/Shanghai`}),
 myDate.toLocaleString(`zh`, {timeZone: `Asia/Shanghai`}),
 myDate.toLocaleString(`en-CA`, {timeZone: `Pacific/Auckland`}),].join(`\n`)
);

So, afaik using JS Date, it is not possible to retrieve a time zone from a locale.

In this Stackblitz project I have related a number of cities to their time zone, using world-timedate.com which was quite cumbersome.

Here is a library I created to make working with JS Dates a bit more easy. Maybe it's useful.

answered Apr 16, 2025 at 12:27
Sign up to request clarification or add additional context in comments.

1 Comment

"So, afaik using JS Date, it is not possible to retrieve a time zone from a locale." No, you can't get a time zone name from a locale. But you can get a localised time zone name from an IANA time zone name (which Intl.supportedValuesOf('timeZone') provides) using Intl.DateTimeFormat jsbin.com/tereyituzi/1/edit?js,console However, you can't get the IANA name localised. These are the options for the time zone name.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.