
Security News
The Changelog Podcast: Practical Steps to Stay Safe on npm
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.
my-timezone
Advanced tools
Get the exact time based on your location by calculating the time difference in seconds from UTC (good explanation on CS4FN).
ℹ️ This is a pure ESM module.
Add the module to your project with yarn add my-timezone or install it globally with yarn global add my-timezone.
import {MyTimezone} from 'my-timezone';
new MyTimezone()
.getTimeByAddress('Berlin, Germany')
.then(date => {
console.log(date.toString()); // Sun Sep 03 2017 14:29:49 GMT+0200
})
.catch(error => console.error(error));
// or
new MyTimezone()
.getTimeByLocation('13.394')
.then(date => {
console.log(date.toString()); // Sun Sep 03 2017 14:29:49 GMT+0200
})
.catch(error => console.error(error));
Usage: my-timezone [options] <location>
Get the exact time based on your location.
Use a city name or longitude value as location.
Options:
-V, --version output the version number
-o, --offline Work offline (default is false)
-s, --server Specify the NTP server (default is "pool.ntp.org")
-h, --help output usage information
FAQs
Get the exact time based on your location.
The npm package my-timezone receives a total of 12 weekly downloads. As such, my-timezone popularity was classified as not popular.
We found that my-timezone demonstrated a healthy version release cadence and project activity because the last version was released less than 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.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.

Security News
Ruby's creator Matz assumes control of RubyGems and Bundler repositories while former maintainers agree to step back and transfer all rights to end the dispute.