parse-zonetab
A Node module to parse zone.tab file
const parseZonetab = ; const source = `## tz zone descriptions#AD +4230+00131 Europe/AndorraAE +2518+05518 Asia/DubaiAF +3431+06912 Asia/KabulAG +1703-06148 America/AntiguaAI +1812-06304 America/Anguilla`; ;
Installation
npm install parse-zonetab
API
const parseZonetab = ;
parseZonetab(source)
source: Buffer
, String
or Stream
Return: Promise
It takes zone.tab
file data and returns a promise for an array of parsed rows each of whom is in the form:
{
countryCode: <string>,
coordinate: {
latitude: {
sign: <string> ('+' or '-'),
degree: <int>,
minute: <int>,
[second: <int>] (if available)
},
longitude: {
sign: <string> ('+' or '-'),
degree: <int>,
minute: <int>,
[second: <int>] (if available)
}
},
id: <string>,
[comment: <string>] (if available)
}
Related project
- get-zonetab - get the latest
zone.tab
file form IANA Time Zone Database
License
Copyright (c) 2016 Shinnosuke Watanabe
Licensed under the MIT License.