# timezone-conversions

> Convert datetime from one timezone to another

Latest version **1.1.6** (published 2021-03-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install timezone-conversions
pnpm add timezone-conversions
yarn add timezone-conversions
bun add timezone-conversions
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.6 |
| Published | 2021-03-20 |
| First published | 2021-03-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 5.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | amanlatkar.com |
| Maintainers | amanlatkar |
| Keywords | convert-timezone, timezone-conversions, local-datetime, UTC-to-local-datetime, datetime, timezone, timezones, angular-datetime, react-datetime, node-datetime |

## Links

- npm: https://www.npmjs.com/package/timezone-conversions
- Repository: https://github.com/amanlatkar/timezone-conversions
- Homepage: https://github.com/amanlatkar/timezone-conversions#readme
- Issues: https://github.com/amanlatkar/timezone-conversions/issues
- npm.io page: https://npm.io/package/timezone-conversions

## 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

- 1.1.6 (latest) — 2021-03-20
- 1.1.5 — 2021-03-20
- 1.1.4 — 2021-03-20
- 1.1.3 — 2021-03-19
- 1.1.2 — 2021-03-19
- 1.1.1 — 2021-03-19
- 1.1.0 — 2021-03-19
- 1.0.3 — 2021-03-19
- 1.0.2 — 2021-03-19
- 1.0.1 — 2021-03-19
- 1.0.0 — 2021-03-19

## README

# timezone-conversions

Functionality

1. Convert datetime from one timezone to another

2. Get current datetime of any timezone

## Installation

`npm install timezone-conversions`

## Getting started

For NodeJS

```javascript
const { Convert_TZ, CurrentDateTime } = require("timezone-conversions");
```

For Angular, React

```javascript
import { Convert_TZ, CurrentDateTime } from "timezone-conversions";
```

For Web

```html
<script src="https://d8y0bt6o4sw75.cloudfront.net/timezone-conversions.js"></script>
```

## Examples

```javascript
// Convert datetime from one time timezone to another
Convert_TZ("YYYY-MM-DD HH:mm:ss", from_timezone, to_timezone);
// Convert_TZ("2021-03-19 10:15:00", "+05:30", "+07:00"); => 2021-03-19 11:45:00 +07:00

// Get Current datetime of any timezone
CurrentDateTime(timezone);
// CurrentDateTime("+05:30"); => 2021-03-20 02:12:00 +05:30
```

## Reference

Supported timezones https://en.wikipedia.org/wiki/List_of_time_zones_by_country

Supported datetime formats for timezone conversions
| Format | Example |
| ------------- | ------------- |
| YYYY-MM-DDTHH:mm:ss | 2021-03-19T10:15:00 |
| YYYY-MM-DD HH:mm:ss | 2021-03-19 10:15:00 |
| YYYY-MM-DD HH:mm:ss A | 2021-03-19 10:15:00 AM |
| YYYY-MM-DD HH:mm:ss:SSS | 2021-03-19 10:15:00:000 |
| YYYY-MM-DD HH:mm | 2021-03-19 10:15 |

## License

© 2021 Aman Latkar [amanlatkar.com](https://amanlatkar.com), MIT license.

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