<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<script language="javascript">
function datetime1()
{
AllMyDate=new Date() ;
var MyYear=AllMyDate.getYear();
var MyMonth=AllMyDate.getMonth()+1;
if(MyMonth<10)
MyMonth="0"+MyMonth;
var MyDate=AllMyDate.getDate();
if(MyDate<10)
MyDate="0"+MyDate;
var MyHours=AllMyDate.getHours();
if(MyHours<10)
MyMyHours="0"+MyHours;
var MyMinutes=AllMyDate.getMinutes();
if(MyMinutes<10)
MyMinute="0"+MyMinute;
var MySeconds=AllMyDate.getSeconds();
if( MySeconds<10)
MySeconds="0"+ MySeconds;
my.innerHTML="现在时间:"+MyYear+"年"+MyMonth+"月"+ MyDate+"日"+
MyHours+"点"+MyMinutes+"分"+MySeconds+"秒";
setTimeout("datetime1()",1000);
}
</script>
</head>
<body onLoad="datetime1()">
<div id="my"></div>
</body>
</html>