browser-tz
Timezone specific manipulation of datetime strings
Designed to be used on top of another library. Initial
implementation is build on top of moment-timezone
Motivation
This is a set of minimal operation needed to deal with timezone
in javascript. It focuses on only having one canonical
representation of a time, namely an ISO8601 string.
Example
var Timezone = require("browser-tz")
var timezoneData = require("moment-timezone/moment-timezones.json")
var tz = Timezone(timezoneData)
var today = new Date().toISOString()
var todayInNewYork = tz.IsoString(today, "America/New_York")
var tomorrowInNewYork = tz.addDay({
iso: todayInNewYork,
timezone: "America/New_York"
}, 1)
Installation
npm install browser-tz
Contributors
MIT Licenced