javascript date add 2 hours code example
Example 1: date add hours javascript
Date.prototype.addHours = function(h) {
this.setTime(this.getTime() + (h*60*60*1000));
return this;
}
Example 2: add 2 for hours in date timestamp js
Date.prototype.addHours= function(h){
this.setHours(this.getHours()+h);
return this;
}
alert(new Date().addHours(4));