Set the date time to be 90 minutes ago: - Javascript Date

Javascript examples for Date:setMinutes

Description

Set the date time to be 90 minutes ago:

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  w ww  .  ja  va2  s . c o m
    var d = new Date();
    d.setMinutes(d.getMinutes() - 90);
    document.getElementById("demo").innerHTML=d;
}
</script>

</body>
</html>

Related Tutorials