Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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
```