Set the date time to be 90 minutes ago, using UTC methods: - Javascript Date

Javascript examples for Date:setUTCMinutes

Description

Set the date time to be 90 minutes ago, using UTC methods:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

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

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

<script>
function myFunction() {//w  w w.j  ava2  s. c o  m
    var d = new Date();
    d.setUTCMinutes(d.getUTCMinutes() - 90);
    document.getElementById("demo").innerHTML = d;
}
</script>

</body>
</html>

Related Tutorials