Get hours between two dates - Node.js Date

Node.js examples for Date:Hour

Description

Get hours between two dates

Demo Code

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

Related Tutorials