Skip to content

shinnn/get-tz

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

get-tz

NPM version Build Status Coverage Status Dependency Status devDependency Status

A Node module to get time zone data form IANA Time Zone Database

const getTz = require('get-tz');

getTz().then(rows => {
  rows; /* => [
    {
      countryCode: 'AD',
      coordinate: {
        latitude: {sign: '+', degree: 42, minute: 30},
        longitude: {sign: '+', degree: 1, minute: 31}
      },
      id: 'Europe/Andorra'
    },
    {
      countryCode: 'AE',
      coordinate: {
        latitude: {sign: '+', degree: 25, minute: 18},
        longitude: {sign: '+', degree: 55, minute: 18}
      }
      id: 'Asia/Dubai'
    },
    ...
  ] */  
})

Installation

Use npm.

npm install get-tz

API

const getTz = require('get-tz');

getTz([options])

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

It gets the latest zone.tab file form https://www.iana.org/time-zones and returns a promise for an array of parsed TSV data.

License

Copyright (c) 2016 Shinnosuke Watanabe

Licensed under the MIT License.

About

Get time zone data from IANA time zone database

Resources

License

Stars

Watchers

Forks

Packages

No packages published