Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

timezone-conversions

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

timezone-conversions

Convert datetime from one timezone to another

  • 1.1.6
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
6
decreased by-33.33%
Maintainers
1
Weekly downloads
 
Created
Source

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

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

For Angular, React

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

For Web

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

Examples

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

FormatExample
YYYY-MM-DDTHH:mm:ss2021-03-19T10:15:00
YYYY-MM-DD HH:mm:ss2021-03-19 10:15:00
YYYY-MM-DD HH:mm:ss A2021-03-19 10:15:00 AM
YYYY-MM-DD HH:mm:ss:SSS2021-03-19 10:15:00:000
YYYY-MM-DD HH:mm2021-03-19 10:15

License

© 2021 Aman Latkar amanlatkar.com, MIT license.

Keywords

FAQs

Package last updated on 20 Mar 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc