# time-zone

> Pretty time zone: `+2` or `-9:30`

Latest version **2.0.0** (published 2021-04-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install time-zone
pnpm add time-zone
yarn add time-zone
bun add time-zone
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2021-04-20 |
| First published | 2016-07-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM |
| Node | >=12 |
| Dependencies | 0 |
| Unpacked size | 2.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 58 |
| Author | Sindre Sorhus |
| Maintainers | sindresorhus |
| Keywords | timezone, utc, time, pretty, human, date, iso, zone |

## Links

- npm: https://www.npmjs.com/package/time-zone
- Repository: https://github.com/sindresorhus/time-zone
- Homepage: https://github.com/sindresorhus/time-zone#readme
- Issues: https://github.com/sindresorhus/time-zone/issues
- Funding: https://github.com/sponsors/sindresorhus
- npm.io page: https://npm.io/package/time-zone

## Alternatives

- [@js-joda/timezone](https://npm.io/package/@js-joda/timezone.md) — 383.4K weekly downloads
- [chartjs-adapter-moment](https://npm.io/package/chartjs-adapter-moment.md) — 210.8K weekly downloads
- [strftime](https://npm.io/package/strftime.md) — 171.2K weekly downloads
- [vue-flatpickr-component](https://npm.io/package/vue-flatpickr-component.md) — 115.8K weekly downloads
- [timepicker](https://npm.io/package/timepicker.md) — 51.0K weekly downloads

## Recent versions

- 2.0.0 (latest) — 2021-04-20
- 1.0.0 — 2017-01-13
- 0.1.0 — 2016-07-20

## README

# time-zone

> Pretty [time zone](https://en.wikipedia.org/wiki/Time_zone): `+2` or `-9:30`

## Install

```
$ npm install time-zone
```

## Usage

```js
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.

---
_Source: https://npm.io/package/time-zone · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
