msecs
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

millisecond intervals

This "library" provides the following constants:

  • millisecond = 1;
  • second = 1000 * millisecond;
  • minute = 60 * second;
  • hour = 60 * minute;
  • day = 24 * hour;
  • week = 7 * day;

So you can do easy to read math on your dates!

import { day, week } from "msecs";

const now = new Date();
const tomorrow = new Date(now + day);
const inTwoWeeks = new Date(now + 2 * week);
const midnight = new Date(now - (now % day) + 1 * day);

Readme

Keywords

none

Package Sidebar

Install

npm i msecs

Weekly Downloads

555

Version

1.0.3

License

ISC

Unpacked Size

4.41 kB

Total Files

11

Last publish

Collaborators

  • elmerbulthuis