The toDateString Method

The toDateString() method converts a date to a more readable format:

HTML file: Displayed by browser:
<body>
<p id="demo"></p>

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

Date objects are static, not dynamic. The computer time is ticking, but date objects, once created, are not.

BackTable of ContentsNext