print time from one date to another
npm install timethat
|42||downloads in the last day|
|257||downloads in the last week|
|1 614||downloads in the last month|
|Version||0.0.2 last updated a year ago|
|Keywords||timer, time calc, from time, elapsed time, elapsed|
|Dependents (7)||fast-ui-shifter, grover, grunt-yui-contrib, mod_status, shifter, yogi, yogi-app|
A simple module to print elapsed time from one date to another.
I use this in several of my CLI tools and figured I should export it and not just copy it.
npm i timethat
var timethat = require('timethat'), start = new Date('1/1/2010 3:00:00'), end = new Date('1/1/2010 5:43:21'); console.log(timethat.calc(start, end)); //2 hours, 43 minutes, 21 seconds
var start = new Date('1/1/2010 3:00:00'), end = new Date('1/1/2010 3:21:02'); console.log(timethat.calc(start, end)); //21 minutes, 2 seconds
console.log(timethat.calc(1262336400000, 1262336400150)); //0.15 seconds
You can give it seconds or
Currently at 100% code coverage, reports are in the Travis builds.