sec
Convert a time string to seconds: `'00:22:17'` → `1337`
Last updated 6 years ago by sindresorhus .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install sec 
SYNC missed versions from official npm registry.

sec

Convert a time string to seconds: '00:22:17' → 1337

Install

$ npm install sec

Usage

import toSeconds from 'sec';

// hours:minutes:seconds
toSeconds('00:22:17');
//=> 1337

toSeconds('22:17');
//=> 1337

toSeconds('17');
//=> 17

Current Tags

  • 2.0.0                                ...           latest (6 years ago)

2 Versions

  • 2.0.0                                ...           6 years ago
  • 1.0.0                                ...           11 years ago
Maintainers (1)
Downloads
Total 8
Today 0
This Week 1
This Month 6
Last Day 1
Last Week 2
Last Month 1
Dependencies (0)
None
Dev Dependencies (2)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE