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