Set the time to 15:35:01 UTC time - Javascript Date

Javascript examples for Date:setUTCHours

Description

Set the time to 15:35:01 UTC 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 www .jav  a  2 s.c om
    var d = new Date();
    d.setUTCHours(15, 35, 1);
    document.getElementById("demo").innerHTML = d;
}
</script>

</body>
</html>

Related Tutorials