Subtract 999999999999 milliseconds from January 1, 1970, and display the new date and time: - Javascript Date

Javascript examples for Date:setTime

Description

Subtract 999999999999 milliseconds from January 1, 1970, and display the new date and time:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<button onclick="myFunction()">Test</button>

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

<script>
function myFunction() {/*from ww  w .ja v  a 2s .c o m*/
    var d = new Date();
    d.setTime(-999999999999);
    document.getElementById("demo").innerHTML = d;
}
</script>

</body>
</html>

Related Tutorials