1<html>
2 <head>
3 <title>JavaScript setHours Method</title>
4 </head>
5 <body>
6 <script>
7 var dt = new Date();
8 dt.setHours( dt.getHours() + 2 );
9 document.write( dt );
10 </script>
11 </body>
12</html>
1Date.prototype.addHours = function(h) {
2 this.setTime(this.getTime() + (h*60*60*1000));
3 return this;
4}