Edit This Code:
<!DOCTYPE html>
<html>
<body>

<p>You can use an array to display the name of the weekday:</p>

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

<script>
var d = new Date();
var days = ["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];
document.getElementById("demo").innerHTML = days[d.getDay()];
</script>

</body>
</html>


Result:
Try it Yourself - © w3schools.com
Privacy Policy