blob: 8b2c67b2d265ec57874422cce27eee531fdf846e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
# time-zone [![Build Status](https://travis-ci.org/sindresorhus/time-zone.svg?branch=master)](https://travis-ci.org/sindresorhus/time-zone)
> Pretty [time zone](https://en.wikipedia.org/wiki/Time_zone): `+2` or `-9:30`
## Install
```
$ npm install --save time-zone
```
## Usage
```js
const timeZone = require('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`<br>
Default: `new Date()`
Custom date.
## License
MIT © [Sindre Sorhus](https://sindresorhus.com)
|