an easy way of calculating duration between two dates
JavaScript
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.

README.md

duration-calculator

viktort

Build Status

shackpank (fork)

Build Status

A module for calculating the duration between two given dates, irrespective of the order.

Usage

If you have npm installed

$ npm install duration-calculator

Inside a js file:

var durationCalculator = require('duration-calculator');

var duration = durationCalculator.calculate(date1, date2);

console.log('Duration = ' + duration);

##Additional Duration calculator works with Day Light Saving hours too. Tests are in place in test.js. Thanks to Ollie Buck for contributing. Current version in now available from npm.