<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>表单</title>
</head>
<body>
<div id="clock">
</div>
</body>
<script>
function realSysTime(clock)
{
var now = new Date();
var year = now.getFullYear();
var moth = now.getMonth();
var date1 = now.getDate(); //获取日
var day = now.getDay();
var hour = now.getHours();
var minute = now.getMinutes();
var sec = now.getSeconds();
moth+=1;
var arr_week = new Array("星期日","星期一","星期二","星期三","星期四","星期五","星期六");
var week = arr_week[day];
var time = year+"年"+moth+"月"+date1+"日 "+week+" "+hour+":"+minute+":"+sec; //组合系统时间
clock.innerHTML="当前时间:"+time;
}
window.onload=function(){
window.setInterval("realSysTime(clock)",1000);
}
</script>
</html>