<!DOCTYPE html>
<html>
<body>

<p>The internal clock in JavaScript starts at midnight January 1, 1970.</p>
<p>Click the button to display the number of milliseconds since midnight, January 1, 1970.</p>

<button onclick="myFunction()">Try it</button>

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

<script>
function myFunction() {
    var n = Date.now();
    document.getElementById("demo").innerHTML = n;
}
</script>

</body>
</html>