This package has been deprecated

Author message:

This module is now under the @mapbox namespace: install @mapbox/timespace instead

timespace

1.1.0 • Public • Published

timespace Build Status

Compute fuzzy local time from a location.

Install

npm install timespace

Use

var ts = require('timespace');
 
var timestamp = Date.now();
var point = [-122.27783203125, 37.84015683604136];
var time = ts.getFuzzyLocalTimeFromPoint(timestamp, point);
//=> '2016-08-25T16:43:12-07:00'
 
 
var tile = [20,49,7];
var timezone1 = ts.getFuzzyTimezoneFromTile(tile);
//=> 'America/Los_Angeles'
 
var quadkey = '0230102';
var timezone2 = ts.getFuzzyTimezoneFromTile(tile);
//=> 'America/Los_Angeles'
 
// any tiles passed with zoom levels > 7 will return the timezone of its z7 parent

Regenerate timezones.json

npm run regenerate

Package Sidebar

Install

npm i timespace

Weekly Downloads

5

Version

1.1.0

License

MIT

Last publish

Collaborators

  • mapbox-admin