Get your own website Result Size: 625 x 565
x
 
<!DOCTYPE html>
<html>
<body>
<h1>JavaScript Dates</h1>
<h2>The new Date() Method</h2>
<p>new Date() creates a new date object with the current date and time:</p>
<p id="demo"></p>
<script>
const time = new Date();
document.getElementById("demo").innerHTML = time;
</script>
</body>
</html>