Following is the Code for showing Current date.
<!DOCTYPE html>
<html>
<head>
<title>Date</title>
<style>
body {
font-family: sans-serif;
}
.date {
font-size: 20px;
color: gray;
}
</style>
</head>
<body>
<div class="date"></div>
<script>
// Get the current date
var today = new Date();
// Format the date as a string
var date_string = today.toLocaleDateString();
// Display the date on the web page
document.querySelector(".date").innerHTML = date_string;
</script>
</body>
</html>
Comments
Post a Comment