get-tz-ids

Get an array of time zone IDs from IANA time zone database

Usage no npm install needed!

<script type="module">
  import getTzIds from 'https://cdn.skypack.dev/get-tz-ids';
</script>

README

get-tz-ids

NPM version Build Status Coverage Status Dependency Status devDependency Status

A Node module to get an array of time zone IDs form IANA Time Zone Database

const getTzIds = require('get-tz-ids');

getTzIds().then(ids => {
  ids; //=> ['Africa/Abidjan', 'Africa/Accra', 'Africa/Addis_Ababa', 'Africa/Algiers', ...]
});

Installation

Use npm.

npm install get-tz-ids

API

const getTzIds = require('get-tz-ids');

getTzIds([options])

options: Object (directly passed to Request)
Return: Promise

It fetches and parses the latest zone.tab file form https://www.iana.org/time-zones and returns a promise for an array of alphabetically sorted time zone IDs.

Related project

  • get-tz - Get all time zone info instead of IDs only

License

Copyright (c) 2016 Shinnosuke Watanabe

Licensed under the MIT License.