time-zone
Pretty time zone: `+2` or `-9:30`
Last updated 6 years ago by sindresorhus .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install time-zone 
SYNC missed versions from official npm registry.

time-zone

Pretty time zone: +2 or -9:30

Install

$ npm install time-zone

Usage

import timeZone from 'time-zone';

// Current time zone (in Norway)
timeZone();
//=> '+2'

// Time zone in February (in Norway)
timeZone(new Date(2016, 1, 1));
//=> '+1'

// Current time zone (in French Polynesia)
timeZone();
//=> '-9:30'

API

timeZone(date?)

date

Type: Date
Default: new Date()

Custom date.

Current Tags

  • 2.0.0                                ...           latest (6 years ago)

3 Versions

  • 2.0.0                                ...           6 years ago
  • 1.0.0                                ...           10 years ago
  • 0.1.0                                ...           10 years ago
Maintainers (1)
Downloads
Total 8
Today 0
This Week 0
This Month 7
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (2)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE