1.0.15 • Published 5 years ago

timezone-id v1.0.15

Weekly downloads
22
License
ISC
Repository
github
Last release
5 years ago

update: 01.01.2020

If you want to find tz by city name, you need to get the key for geocoder here

Description

timezone client module for node.js that provides an asynchronous interface for getting timezone by city name or coords. zone ID will be retrieved from here:

  1. https://geocode-maps.yandex.ru/1.x/?geocode=[city]&format=json&results=1
  2. https://api.teleport.org/api/locations/[coordinates]/?embed=location:nearest-cities/location:nearest-city/city:timezone

Requirements

  • node.js -- v0.8.0 or newer
  • API_KEY from here -- for city names

Install

npm install timezone-id

Examples

  • Get a timezone by city name:
  var tz = require('timezone-id');
  
  tz.getTimeZone('Sydney', API_KEY).then(timeZoneId => {
        console.log(timeZoneId); //Australia/Sydney
      })
  • Get a timezone by location coordinates:
  var tz = require('timezone-id');
    tz.getTimeZone([55.755814, 37.617635]).then(timeZoneId => {
          console.log(timeZoneId); //Asia/Tehran
        })
1.0.15

5 years ago

1.0.14

5 years ago

1.0.13

6 years ago

1.0.12

6 years ago

1.0.11

6 years ago

1.0.10

6 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago