Nodejs Second Add addSecond()

Here you can find the source of addSecond()

Method Source Code

/**/*  w w  w  .j  av  a  2 s . c om*/
 * Increment second
 */
Date.prototype.addSecond = function addSecond () {
  this.setSeconds(this.getSeconds() + 1);
};

Related

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