<!DOCTYPE html>
<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>
</html>