Get your own website Result Size: 625 x 565
x
 
<!DOCTYPE html>
<html>
<body>
<h1>JavaScript Dates</h1>
<h2>The getHours() Method</h2>
<p>getHours() returns the hour (from 0 to 23) of a date:</p>
<p id="demo"></p>
<script>
const d = new Date("July 21, 1983 01:15:00");
let hour = d.getHours();
document.getElementById("demo").innerHTML = hour;
</script>
</body>
<!-- Mirrored from www.w3schools.com/jsref/tryit.asp?filename=tryjsref_gethours2 by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 21 Dec 2022 17:39:07 GMT -->
</html>