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.
timezoned-date
Advanced tools
Constructors and objects behave exactly like built-in Date; the TZ offset is configurable
Constructors and objects behave exactly like built-in
Date
; the TZ offset is configurable
Tested against Test262 for the compatibility with Date
.
No support for daylight saving time. Fixed offsets only.
$ npm install --save timezoned-date
const timezonedDate = require('timezoned-date');
console.log(new Date());
// Sat Sep 19 2017 02:39:56 GMT+0300 (Ixania Daylight Time)
const UtcDate = timezonedDate.makeConstructor(0);
console.log(new UtcDate());
// Fri Sep 18 2017 23:39:56 GMT+0000 (UTC)
global.Date = timezonedDate.makeConstructor(240); // minutes
console.log(new Date());
// Sat Sep 19 2017 03:39:56 GMT+0400
An example of using it with jsdom:
const dom = new JSDOM(`<p>Hello</p>`, {
beforeParse(window) {
window.Date = timezonedDate.makeConstructor(240);
}
});
Returns a constructor function compatible with Date
bound to the specified offset.
Apache 2.0 © 2013-2017 James A. Rosen, Georgii Dolzhykov
FAQs
Constructors and objects behave exactly like built-in Date; the TZ offset is configurable
The npm package timezoned-date receives a total of 35,568 weekly downloads. As such, timezoned-date popularity was classified as popular.
We found that timezoned-date 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.