1
<p id="demo">单击按钮显示以毫秒来设置的时间:</p>
2
<button onclick="myFunction()">点我</button>
3
<script>
4
function myFunction() {
5
var d = new Date();
6
d.setTime(1332403882588);
7
var x = document.getElementById("demo");
8
x.innerHTML = d;
9
}
10
</script>