简单教程
提交运行
代码编辑器:
<p id="demo">单击按钮按照UTC显示给定时间的毫秒数</p> <button onclick="myFunction()">点我</button> <script> function myFunction(){ var d = new Date("July 21, 1983 01:15:00:195"); var x = document.getElementById("demo"); x.innerHTML=d.getUTCMilliseconds(); } </script>
运行结果: