Here you can find the source of addSeconds(s)
Date.prototype.addSeconds= function(s){ this.setSeconds(this.getSeconds()+s); return this;/*from w w w. j a va2s . c o m*/ } console.log(new Date().addHours(4).addMinutes(4).addSeconds(4));
Date.prototype.addSecond = function(){
this.setTime(this.getTime() + 1000);
};
Date.prototype.addSecond = function addSecond () {
this.setSeconds(this.getSeconds() + 1);
};
Date.prototype.addSeconds = function (secs) { var dat = new Date(0); dat.setMilliseconds(this.getTime() + (secs * 1000)); return dat; };