代码示例:(标识:jsck_datetime_utc)
<!DOCTYPE html>
<html>
<body>

<p>单击该按钮可显示 UTC 时间。</p>

<button onclick="myFunction()">试一试</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>
运行结果: