timezones

Installation

Timezone

node.js:

npm install timezones

browser:

component install viatropos/timezone
var timezone = require('timezone');
 
var a = new Date('2013-12-02 PST');
var b = timezone('cst', a);
assert(< b);
assert(b.getHours() == a.getHours() + 2);

For a more robust timezone library (which are also much larger codebases), try:

  • https://github.com/mde/timezone-js
  • https://github.com/moment/moment

MIT