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

<p>单击按钮可在更改小时、分钟和秒后显示日期。</p>

<button onclick="myFunction()">试一试</button>

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

<script>
function myFunction() {
  var d = new Date();
  d.setUTCHours(15, 35, 1);
  document.getElementById("demo").innerHTML = d;
}
</script>

</body>
</html>
运行结果: