Security News
UK Officials Consider Banning Ransomware Payments from Public Entities
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.
@phensley/timezone
Advanced tools
Compact timezone library provides the full range of tzdb data. https://data.iana.org/time-zones/tz-link.html
NPM:
npm install --save @phensley/timezone
Yarn:
yarn add @phensley/timezone
Resolve old timezone ids that are deprecated.
import { TZ } from '@phensley/timezone';
const id = TZ.resolveId('Pacific/Samoa');
console.log(id);
Pacific/Pago_Pago
Timezone offsets are in milliseconds.
const ZONES = [
'UTC',
'Pacific/Samoa',
'America/New_York',
'Pacific/Pago_Pago',
'Asia/Tokyo',
'Europe/Paris',
];
const now = new Date(2020, 2, 18, 12, 30, 0).getTime();
for (const zoneid of ZONES) {
const info = TZ.fromUTC(zoneid, now);
console.log(`${zoneid.padEnd(18)} -> ${JSON.stringify(info)}`);
}
UTC -> {"abbr":"UTC","dst":0,"offset":0,"zoneid":"Etc/UTC"}
Pacific/Samoa -> {"abbr":"SST","dst":0,"offset":-39600000,"zoneid":"Pacific/Pago_Pago"}
America/New_York -> {"abbr":"EDT","dst":1,"offset":-14400000,"zoneid":"America/New_York"}
Pacific/Pago_Pago -> {"abbr":"SST","dst":0,"offset":-39600000,"zoneid":"Pacific/Pago_Pago"}
Asia/Tokyo -> {"abbr":"JST","dst":0,"offset":32400000,"zoneid":"Asia/Tokyo"}
Europe/Paris -> {"abbr":"CET","dst":0,"offset":3600000,"zoneid":"Europe/Paris"}
Returns the corresponding UTC timestamp along with a zone info record.
// Sun Mar 8 2020 02:10:00 AM NY time
const epoch = 1583633400000;
const zoneid = 'America/New_York';
const [utc, info] = TZ.fromUTC(zoneid, now)!;
console.log(utc);
console.log(JSON.stringify(info));
1583651400000
{"abbr":"EDT","dst":1,"offset":-14400000,"zoneid":"America/New_York"}
[1.2.9]
FAQs
Compact timezone lib based on tz database
The npm package @phensley/timezone receives a total of 813 weekly downloads. As such, @phensley/timezone popularity was classified as not popular.
We found that @phensley/timezone demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.
Security News
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.