App下载
实例代码( Tip: 登录后体验更佳 )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>W3Cschool(w3cschool.cn)</title>
</head>
<body>
<p id="demo">UTC</p>
<button onclick="myFunction()"></button>
<script>
function myFunction(){
var d = new Date("July 21, 1983 01:15:00");
var x = document.getElementById("demo");
x.innerHTML=d.getUTCFullYear();
}
</script>
</body>
</html>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
运行结果