Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/quaelin/timeframe-to-seconds
Convert '<number><unit>' timeframes into number of seconds
https://github.com/quaelin/timeframe-to-seconds
Last synced: 3 days ago
JSON representation
Convert '<number><unit>' timeframes into number of seconds
- Host: GitHub
- URL: https://github.com/quaelin/timeframe-to-seconds
- Owner: quaelin
- Created: 2016-04-22T07:16:28.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2023-01-04T04:54:15.000Z (about 2 years ago)
- Last Synced: 2024-03-23T11:03:47.866Z (10 months ago)
- Language: JavaScript
- Size: 70.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
```js
const timeframeToSeconds = require('timeframe-to-seconds');timeframeToSeconds('1m'); // 60
timeframeToSeconds('3m'); // 180
timeframeToSeconds('1h'); // 3600
timeframeToSeconds('2h'); // 7200
timeframeToSeconds('1d'); // 86400
timeframeToSeconds('1w'); // 604800
``````sh
$ npx timeframe-to-seconds 12h
43200
```