parse-tzdata-coordinate
Parse a coordinate string in zone.tab
format
import parseTzdataCoordinate from 'parse-tzdata-coordinate';
parseTzdataCoordinate('+394606-0860929');
Installation
npm install parse-tzdata-coordinate
bower install parse-tzdata-coordinate
API
parseTzdataCoordinate(str)
str: String
Return: Object
It takes a string of time zone coordinates in tz database format:
Latitude and longitude of the zone's principal location in ISO 6709 sign-degrees-minutes-seconds format, either +-DDMM+-DDDMM
or +-DDMMSS+-DDDMMSS
, first latitude (+
is north), then longitude (+
is east).
and returns an object in the form:
{
latitude: {
sign: <string> ('+' or '-'),
degree: <int>,
minute: <int>,
[second: <int>] (if available)
},
longitude: {
sign: <string> ('+' or '-'),
degree: <int>,
minute: <int>,
[second: <int>] (if available)
}
}
parseTzdataCoordinate('+394606-0860929');
License
Copyright (c) 2016 Shinnosuke Watanabe
Licensed under the MIT License.