<html>
<body>
<p>Click the button to display the UTC time.</p>
<button onclick="myFunction()">Try it</button>
<p id="demo"></p>
<script>
function addZero(i) {
if (i < 10) {
i = "0" + i;
}
return i;
}
function myFunction() {
var d = new Date();
var x = document.getElementById("demo");
var h = addZero(d.getUTCHours());
var m = addZero(d.getUTCMinutes());
var s = addZero(d.getUTCSeconds());
x.innerHTML = h + ":" + m + ":" + s;
}
</script>
</body>
<!-- Mirrored from www.w3schools.com/jsref/tryit.asp?filename=tryjsref_datetime_utc by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 05 Jun 2019 14:02:05 GMT -->
</html>