Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Valid IANA timezone list

I'm working on an Nodejs system support multi timezone users. Currently, I'm using moment.tz.names() to get list of available timezone. But I found out that some timezone in list is deprecated by this link. I also found this database from IANA. So is there anyway to keep my timezone data up to date? I'm trying to find a way to work with IANA database. Thank you if there are any other approaches.

like image 788
Nguyen Hoang Vu Avatar asked Jan 27 '26 07:01

Nguyen Hoang Vu


1 Answers

I'd take a look at the tzdb package. It includes all IANA zones and is automatically updated on changes. You can get a list of timezones easily:

const { getTimeZones } = require("@vvo/tzdb");
const timeZones = getTimeZones();

console.log("Timezone (Berlin):", timeZones.find(tz => tz.name === "Europe/Berlin"));
console.log("Timezone (LA):", timeZones.find(tz => tz.name === "America/Los_Angeles"));
like image 88
Terry Lennox Avatar answered Jan 30 '26 00:01

Terry Lennox



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!