
Company News
Andrew Becherer Joins Socket as Chief Information Security Officer
Socket’s first CISO brings deep experience securing high-growth SaaS companies as open source supply chain threats accelerate.
@eds-fw/timeparser
Advanced tools
Simply string time converter (en/ru)
From "5d2h" to 439200000 ms
parseTime (time: string): ParsedTime | null as default
alias:
timeParser
deparseTime (ms: number, separator?: string): string
alias:
timeDeparser
limitms: number as consttimeRegExp: Record<number, RegExp> as consttimeRegExpNames: Record<string, RegExp> as consttimeNamesMap: Record<number, string> as constlimitsMap: Record<number, number> as constParsedTime: {...}v18 or newertimeparser via npm:npm i @eds-fw/timeparser
timeparser:// file.js, type: CommonJS
const { parseTime } = require("@eds-fw/timeparser");
let unparsed = "1h5week";
let parsed = parseTime(unparsed);
console.log(parsed.ms); //3_027_600_000 ms
console.log(parsed.seconds); //3_027_600 sec
or...
// file.js, type: ESM
import parseTime from "@eds-fw/timeparser";
let unparsed = "1h5week";
let parsed = parseTime(unparsed);
console.log(parsed.ms); //3_027_600_000 ms
console.log(parsed.seconds); //3_027_600 sec
(cjs) parseTime("1s") x 298,020 ops/sec ±3.32% (79 runs sampled)
(cjs) parseTime("1s").ms x 305,508 ops/sec ±1.69% (85 runs sampled)
(cjs) parseTime("1s").years x 318,852 ops/sec ±1.09% (88 runs sampled)
(cjs) parseTime("1s")._deparsed x 180,819 ops/sec ±0.80% (85 runs sampled)
(cjs) parseTime("1y2mth3w4d5h6s7ms") x 113,347 ops/sec ±0.68% (92 runs sampled)
(cjs) parseTime("1y2mth3w4d5h6s7ms").ms x 112,755 ops/sec ±0.94% (93 runs sampled)
(cjs) parseTime("1y2mth3w4d5h6s7ms").years x 109,757 ops/sec ±0.82% (94 runs sampled)
(cjs) parseTime("1y2mth3w4d5h6s7ms")._deparsed x 78,401 ops/sec ±2.21% (85 runs sampled)
(esm) parseTime("1s") x 288,259 ops/sec ±3.17% (82 runs sampled)
(esm) parseTime("1s").ms x 326,667 ops/sec ±1.32% (89 runs sampled)
(esm) parseTime("1s").years x 326,308 ops/sec ±0.92% (85 runs sampled)
(esm) parseTime("1s")._deparsed x 183,746 ops/sec ±0.73% (91 runs sampled)
(esm) parseTime("1y2mth3w4d5h6s7ms") x 104,508 ops/sec ±0.70% (90 runs sampled)
(esm) parseTime("1y2mth3w4d5h6s7ms").ms x 103,322 ops/sec ±0.59% (91 runs sampled)
(esm) parseTime("1y2mth3w4d5h6s7ms").years x 101,831 ops/sec ±1.13% (88 runs sampled)
(esm) parseTime("1y2mth3w4d5h6s7ms")._deparsed x 73,778 ops/sec ±2.42% (82 runs sampled)
FAQs
Simply string time converter (en/ru). From "5d2h" to 439200000 ms
We found that @eds-fw/timeparser 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.

Company News
Socket’s first CISO brings deep experience securing high-growth SaaS companies as open source supply chain threats accelerate.

Company News
Replit is integrating Socket Firewall into its AI-powered development experience to help protect builders from malicious open source packages.

Security News
npm confirmed a tooling bug incorrectly marked several one-character packages as security holders and said it was working on a rollback.