1.4.0 • Published 7 years ago

tzlookup v1.4.0

Weekly downloads
57
License
MIT
Repository
github
Last release
7 years ago

tzlookup NPM version Build Status

NodeJS Module for timezone lookup by geo location

Install

npm install tzlookup --save

Usage

const tz = require('tzlookup').tzNameAt;

console.log(tz(40.7092, -74.0151));
// => America/New_York

Also you can get all timezone names

var tzNames = require('tzlookup').tzNames;

console.log(tzNames.filter(function (name) { return /Europe/.test(name) }));
// => [ 'Europe/Amsterdam',
//      'Europe/Andorra',
//      'Europe/Athens',
//      'Europe/Belgrade',
//      ...

API

tzNameAt(lat, lon)

lat

Required
Type: Number

Latitude – number between -90 and +90.

lon

Required
Type: Number

Longitude – number between -180 and +180.

Function with two arguments – latitude and longitude. Throws TypeError if arguments is not a Number and RangeError if at least one of them is out of range.

tzNames

Returns the list of all known names of the timezones.

Lisense

MIT © Maxim Novikov

1.4.0

7 years ago

1.3.0

7 years ago

1.2.1

8 years ago

1.2.0

8 years ago

1.1.0

8 years ago

1.0.1

8 years ago

1.0.0

9 years ago

0.1.0

9 years ago

0.0.3

9 years ago