Nodejs Utililty Methods Date Subtract

List of utility methods to do Date Subtract

Description

The list of methods to do Date Subtract are organized into topic(s).

Method

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)
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)