Skip to content

Convert '<number><unit>' timeframes into number of seconds

Notifications You must be signed in to change notification settings

quaelin/timeframe-to-seconds

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

const timeframeToSeconds = require('timeframe-to-seconds');

timeframeToSeconds('1m'); // 60
timeframeToSeconds('3m'); // 180
timeframeToSeconds('1h'); // 3600
timeframeToSeconds('2h'); // 7200
timeframeToSeconds('1d'); // 86400
timeframeToSeconds('1w'); // 604800
$ npx timeframe-to-seconds 12h
43200

About

Convert '<number><unit>' timeframes into number of seconds

Resources

Stars

Watchers

Forks

Packages

No packages published