Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where does Intl API get it's time zone list?

I'm relying on Intl to determine user's time zone.

I also want to give users a way to pick their timezone. I have a list of time zones -- some subset of Olson database.

I wanna make sure Intl won't give me some weird time zone I don't have in my list.

Where does Intl API get it's time zone list? Is there a way to list all of them or does it trust the browser?

like image 904
skfd Avatar asked Jul 09 '15 01:07

skfd


1 Answers

According to MDN:

The only value implementations must recognize is "UTC"; the default is the runtime's default time zone. Implementations may also recognize the time zone names of the IANA time zone database, such as "Asia/Shanghai", "Asia/Kolkata", "America/New_York".

like image 89
cgatian Avatar answered Nov 08 '22 17:11

cgatian