moment-timezone-parse
v2.0.1
Published
Parse an the timezone component of a ISO8601 string to get a timezone name
Downloads
12
Maintainers
Keywords
Readme
Moment Timezone Parse
Parse the timezone component of a ISO8601 date string and return an approparite IANA timezone name.
Installation
npm install moment-timezone-parse --save
Usage
const parse = require('moment-timezone-parse');
console.log(parse('2017-11-08T23:16:00-0200').format());
// =>
// Etc/GMT+2
How it works
The timezone designator (i.e. -0200
) is parsed from the string and a timezone name is derived from that string
(i.e. Etc/GMT+2
).