Convert an object of time properties to seconds:
{seconds: 2}
→120
$ npm install @mblackmblack/to-seconds
const toSeconds = require('@mblackmblack/to-seconds');
toSeconds({
days: 15,
hours: 11,
minutes: 23,
seconds: 1
});
//=> 1336981
Type: Object
Specify an object with any of the following properties:
days
hours
minutes
seconds
- to-milliseconds - The inverse of this module
- parse-ms - The inverse of this module
- pretty-ms - Convert milliseconds to a human readable string
This project is forked from https://github.com/sindresorhus/to-milliseconds. Special thanks to sindresorhus
MIT © Matthew Black