Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
timezone-conversions
Advanced tools
Functionality
Convert datetime from one timezone to another
Get current datetime of any timezone
npm install timezone-conversions
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>
// 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
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 |
© 2021 Aman Latkar amanlatkar.com, MIT license.
FAQs
Convert datetime from one timezone to another
The npm package timezone-conversions receives a total of 6 weekly downloads. As such, timezone-conversions popularity was classified as not popular.
We found that timezone-conversions demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.