JavaScript 参考手册
JavaScript toUTCString() 方法
根据世界时 (UTC) 把 Date 对象转换为字符串
源代码:
点击运行 »
<p id="demo">点击按钮把 utc 日期和时间转换成字符串。</p> <button onclick="myFunction()">点我</button> <script> function myFunction() { var d = new Date(); var x = document.getElementById("demo"); x.innerHTML = d.toUTCString(); } </script>
运行结果:
点击运行 »