Simple TypeScript time utility. Time.hours(1) gives 3600000.
const Time = { milliseconds: (ms: number) => ms, seconds: (s: number) => s * 1000, minutes: (m: number) => m * Time.seconds(60), hours: (h: number) => h * Time.minutes(60), days: (d: number) => d * Time.hours(24), weeks: (w: number) => w * Time.days(7), months: (m: number) => m * Time.days(30), years: (y: number) => y * Time.days(365), }Conversation
Notices
-
Embed this notice
Alex Gleason (alex@gleasonator.com)'s status on Sunday, 09-Jul-2023 05:55:14 JST Alex Gleason -
Embed this notice
Tristan B. V. Kildaire ??? (deavmi@gleasonator.com)'s status on Sunday, 09-Jul-2023 07:03:24 JST Tristan B. V. Kildaire ??? @alex This is a sweet namespace based recursion (idk what to call it).
Nice.
Alex Gleason likes this.
-
Embed this notice