Are you first timer at lazacode.org? Why not join us and start exchange your programming knowledge with everyone. Register today!

JS - Add hour to date object

0 votes
3 views
added Jan 28 in Javascript by LC Marshal Lieutenant (15,850 points)
<script>
 var dt = new Date();
 dt.setHours( dt.getHours() + 2 );
 document.write( dt );
</script>

<!--Output-->
<!--Sat Dec 15 2018 15:49:50 GMT+0530 (India Standard Time)-->

 

Please log in or register to response this reference.

lazacode.org - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.
...