Tutorialspoint

Program for adding 2 hours to Javascript

<html>

 <head>
 <title>JavaScript setHours Method</title>
 </head>

 <body>

 <script>
 var dt = new Date();
 dt.setHours( dt.getHours() + 2 );
 document.write( dt );
 </script>

 </body>
</html>

Advertisements
Loading...