sec
Convert a time string to seconds: '00:22:17' → 1337
Last updated 10 years ago by sindresorhus .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ gnpm 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 (4 years ago)

2 Versions

  • 2.0.0                                ...           4 years ago
  • 1.0.0                                ...           10 years ago
Downloads
Today 0
This Week 0
This Month 2
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (1)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |