Nodejs Date Subtract subtract(b)

Here you can find the source of subtract(b)

Method Source Code

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. subtractNow(b)
    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)