Security News
New Proposed CISA Mandate Would Require Critical Infrastructure to Report Ransom Payments Within 24 Hours
CISA has proposed a set of new rules that would require critical infrastructure to report cyber incidents and ransom payments.
set-tz
Advanced tools
sets the timezone for your short-lived node.js process in any OS-Windows too
Weekly downloads
Readme
sets the timezone for your node.js process across all OSes
const setTZ = require('set-tz')
setTZ('UTC')
// that's it
It will even convert between operating systems
const setTZ = require('set-tz')
setTZ('America/New_York')
This will set timezone to America/New_York in non-Windows environments. In Windows environments, it will set the timezone to Eastern Standard Time (because Windows doesn't respect IANA timezones).
It is very common you want to run all your tests in UTC no matter which timezone your computer is in. If you need that, then you can use a shortcut:
"jest": {
"setupFiles": ['set-tz/utc']
}
On windows, when you call setTZ()
it effectively changes your whole OS timezone so beware-if you kill the process, you'll need to manually revert back after you're done-I am assuming you'r process is short-lived. If you don't kill your process, it will revert your original timezone back for you.
On all other OSes, it just sets process.env.TZ
, so beware that the current process won't have the timezome set. Only it's children.
FAQs
sets the timezone for your short-lived node.js process in any OS-Windows too
The npm package set-tz receives a total of 7,416 weekly downloads. As such, set-tz popularity was classified as popular.
We found that set-tz 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.
Security News
CISA has proposed a set of new rules that would require critical infrastructure to report cyber incidents and ransom payments.
Security News
Redis is no longer OSS, breaking its explicit commitment to remain under the BSD 3-Clause License forever. This has angered contributors who are now working to fork the software.
Product
Socket AI now enables 'AI detected potential malware' alerts by default, ensuring users benefit from AI-powered state-of-the-art malware detection without needing to opt-in.