<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<script>
function GetDate()
{
var date = new Date();
var year = date.getYear();
var month = date.getMonth()+1;
var day = date.getDate();
var week = date.getDay();
var weeks = new Array("星期日","星期一","星期二","星期三","星期四","星期五","星期六"); //数组存放星期的中文格式
var hour = date.getHours();
var minute = date.getMinutes();
var second = date.getSeconds();
second++;
var time;
if(hour<10)
hour = "0"+hour;
if(hour<12)
time = "AM";
else
hour=parseInt(hour);
time = "PM";
if(hour<10)
hour="0"+hour;
if(minute<10)
minute = "0"+minute;
if(second<10)
second = "0"+second;
GetTime.innerHTML="现在时间是:"+year+"年"+month+"月"+day+"日"+weeks[week]+hour+":"+minute+":"+second+time;
}
</script>
</head>
<body onLoad="setInterval('GetDate()',1000)">
<div id="GetTime">
</div>
</body>
</html>