Get days between two dates - Node.js Date

Node.js examples for Date:Day

Description

Get days between two dates

Demo Code


Date.prototype.daysBetween = function (otherDate) {
  return Math.abs(Math.floor((this - otherDate) / 86400000))
}

Related Tutorials