top of page

Write a JavaScript Program to find the Current Date and Time.

Code:

<!DOCTYPE html>
<html>
<body>

<h2>Today's Date and Time using javascript</h2>

<p id="demo"></p>

<script>
const d = new Date();
document.getElementById("demo").innerHTML = d;
</script>

</body>
</html>

Output:




Source: W3School


The Tech Platform

0 comments
bottom of page