String To Milliseconds
Module that converts the string into milliseconds. Understands following macross:
Time | Macros | Example |
---|---|---|
week | w | 7w |
day | d | 31d |
hour | h | 24h |
minute | m | 60m |
second | s | 60s |
Number without macros would be interpreted as milliseconds.
Installation
npm install string-to-ms
Usage
const stringToMs = ; // return 1814400000; // return 43200000; // return 43200000; // return 600; // return 1371600000; // return 202147207000;
Changelog
2017-12-17:
- Now works in browser too