Answers for "how to use hour in javascript"

2

javascript get midnight tonight

var d = new Date();
d.setHours(24,0,0,0); // next midnight
Posted by: Guest on July-17-2019
3

jquery get 2 hours frmo now

<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>
Posted by: Guest on April-17-2020
2

javascript get hour from date

var myDate = new Date(2019, 11, 24, 10, 33);
var hour = myDate.getHours();
Posted by: Guest on September-22-2020

Code answers related to "how to use hour in javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language