<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>系统时间</title>
<script type="text/javascript">
window.onload=getNowTime;
function getNowTime(){
var nowTime = document.getElementById("nowTime");
var date = new Date();
var y = date.getFullYear();
var month = date.getMonth()+1;
var day = date.getDate();
var h = date.getHours();
var m = date.getMinutes();
var s = date.getSeconds();
if(m<10){
m="0"+m
}
if(h<10){
h="0"+h
}
if(s<10){
s="0"+s
}
date = y+"年"+month+"月"+day+"日 "+ h+":" +m+":"+s
nowTime.innerHTML = date;
}
setInterval("getNowTime()",1000);
</script>
</head>
<body>
<p id="nowTime"></p>
</body>
</html>