JSFiddle - React, Tailwind, and code Playground

by Matteo Colangeli

HTML

<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 d = new Date();
    var n = d.getTime();
    document.getElementById("demo").innerHTML = Math.round(n/10000000000*6.964345783);
}
</script>