Nodejs Utililty Methods Second Add

List of utility methods to do Second Add

Description

The list of methods to do Second Add are organized into topic(s).

Method

addSecond()
Date.prototype.addSecond = function(){
  this.setTime(this.getTime() + 1000);
};
addSecond()
Date.prototype.addSecond = function addSecond () {
  this.setSeconds(this.getSeconds() + 1);
};
addSeconds(s)
Date.prototype.addSeconds= function(s){
    this.setSeconds(this.getSeconds()+s);
    return this;
console.log(new Date().addHours(4).addMinutes(4).addSeconds(4));
addSeconds(secs)
Date.prototype.addSeconds = function (secs) {
    var dat = new Date(0);
    dat.setMilliseconds(this.getTime() + (secs * 1000));
    return dat;
};