显示当前系统时间的代码,我哪里出错了?
<!DOCTYPE html>
<html>
<head>
<title>时间显示</title>
<meta charset="gb2312">
<link rel="stylesheet" type="text/css" href="style.css">
<script language="javascript" type="text/javascript">
window.onload=function(){
showTime();
}
function checkTime(i){
if(i<0){
i="0"+i;
}
return i;
}
function showTime(){
var mydate=new Date();
var year=mydate.getFullYear();
var month=mydate.getMonth()+1;
var date=mydate.getDate();
var day=mydate.getDay();
var hour=mydate.getHours();
var minute=mydate.getMinutes();
var second=mydate.getSeconds();
hour=checkTime(hour);
minute=checkTime(minute);
var arrdate=new Arrey(7)
arrdate[0]="星期日"
arrdate[1]="星期一"
arrdate[2]="星期二"
arrdate[3]="星期三"
arrdate[4]="星期四"
arrdate[5]="星期五"
arrdate[6]="星期六"
document.getElementById("show").innerHTML=""+year+"年"+month+"月"+day+"日"+arrdate[day]+hour+":"+minute+":"+second;
t=setTimeout("showTime",500);
}
</script>
</head>
<body>
<div class="content1">
<div id="show">当前时间显示</div>
</div>
</body>
</html>