new Date(number)

Using new Date(number), creates a new date object as zero time plus the number. Zero time is 01 January 1970 00:00:00 UTC. The number is specified in milliseconds:

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

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

JavaScript dates are calculated in milliseconds from 01 January, 1970 00:00:00 Universal Time (UTC). One day contains 86,400,000 millisecond.

BackTable of ContentsNext