Nodejs Date Subtract subtractNow(b)

Here you can find the source of subtractNow(b)

Method Source Code

Date.prototype.subtractNow = function(b) { 
     return this.subtract(new Date()) 
}
Date.prototype.subtract = function(b) {
   var delta = this.getTime()-b.getTime()
   return new Date(0,0,0,delta/1000/60/60,(delta/1000/60)%60,(delta/1000)%60)
}

Related

  1. subtract(b)
    Date.prototype.subtract = function(b) {
      var delta = this.getTime()-b.getTime()
      return new Date(0,0,0,delta/1000/60/60,(delta/1000/60)%60,(delta/1000)%60)