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:
- https://geocode-maps.yandex.ru/1.x/?geocode=[city]&format=json&results=1
- https://api.teleport.org/api/locations/[coordinates]/?embed=location:nearest-cities/location:nearest-city/city:timezone
Requirements
Install
npm install timezone-id
Examples
- Get a timezone by city name:
var tz = ; tz
- Get a timezone by location coordinates:
var tz = ; tz