timezone-compute

A timezone library with timezone conversion functions

timezone-compute

A timezone library with timezone conversion functions

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)

npm install timezone-compute

  • Raynos