JSPM

  • Created
  • Published
  • Downloads 30063
  • Score
    100M100P100Q152185F
  • License MIT

Small, elegant, Olson educated, timezone aware date math and `strftime` date formatting in pure JavaScript with no dependendcies for Node.js and the browser. Timezone uses the Olson/IANA timezone database. Timezone is aware of every clock transition in the Olson database. Timezones supports the full compilment of `strftime` format specifiers defined by GNU `date`. Timezone can perform date math and adjust for daylight savings time. Timezone works in the browser too where it is less than 3K minified and gzipped.

Package Exports

  • timezone
  • timezone/America
  • timezone/America/Chicago
  • timezone/America/Denver
  • timezone/America/Los_Angeles
  • timezone/America/New_York
  • timezone/Asia
  • timezone/Europe
  • timezone/Europe/Amsterdam
  • timezone/Europe/London
  • timezone/Europe/Malta
  • timezone/Europe/Stockholm
  • timezone/Pacific
  • timezone/de_DE
  • timezone/en_GB
  • timezone/fr_FR
  • timezone/loaded
  • timezone/locales
  • timezone/pl_PL
  • timezone/zones

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (timezone) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Sundial

Timezone Build Status

Format time in JavaScript using the IANA time zone database. (Photo: Sundial by Wolfgang Staudt.)

var tz = require('timezone/loaded'),
    equal = require('assert').equal,
    utc;

// Get POSIX time in UTC.
utc = tz('2012-01-01');

// Convert UTC time to local time in a localize language.
equal(tz(utc, '%c', 'fr_FR', 'America/Montreal'),
      'sam. 31 déc. 2011 19:00:00 EST');

A full-featured time zone aware date formatter for JavaScript.

  • Timezone is a MicroJS library in pure JavaScript with no dependencies that provides timezone aware date math and date formatting.
  • Timezone uses the IANA Database to determine the correct wall clock time anywhere in the world for any time since the dawn of standardized time.
  • Timezone formats dates with a full implementation of strftime formats, including the GNU date extensions.
  • Timezone represents time in POSIX time and local time using RFC 3999 date strings.
  • Timezone is a full featured standards based time library in pure JavaScript for under 3K minified and gzipped.

Hacking

$ git clone --quiet https://github.com/bigeasy/timezone.git
$ cd timezone && make && npm install && npm test

License

The MIT License.