timezone-compute
v0.2.2
Published
A timezone library with timezone conversion functions
Downloads
36
Readme
timezone-compute
A timezone library with timezone conversion functions
Example
The main usage is converting recurring weekly times from one timezone to another.
var timezone = require("timezone-compute")
// date is a Moment Date object.
var date = timezone.time("America/Los_Angeles", Date.now())
var thisWeek = timezone.getISOWeek()
// Monday 9AM this week in America/Los_Angeles
var date2 = timezone.computeUTC({
timezone: "America/Los_Angeles",
minute: 0,
hour: 9,
day: 1,
week: thisWeek.week,
year: thisWeek.year
})
// that time in someone elses timezone
var date3 = timezone.time("America/New_York", date2)
Installation
npm install timezone-compute
Contributors
- Raynos