Convert a time string to seconds: '0017' → 1337
MIT License
Convert a time string to seconds:
'00:22:17'
→1337
$ npm install sec
import toSeconds from 'sec';
// hours:minutes:seconds
toSeconds('00:22:17');
//=> 1337
toSeconds('22:17');
//=> 1337
toSeconds('17');
//=> 17