<body onload="startit()">
<script language="javascript">
<!–
var isn1=null;
var isn2=false;
today=new date();
function stopit()
{
if(isn2)
{
cleartimeout(isn1);
}
isn2=false;
}
function startit()
{
stopit();
isnclock();
}
function isnclock()
{
var now=new date();
var hrs=now.gethours();
var min=now.getminutes();
var sec=now.getseconds();
document.clckh.disp1.value=""+((hrs>12)?hrs-12:hrs);
document.clckh.disp2.value=((min<10)?"0":"")+min;
document.clckh.disp3.value=((sec<10)?"0":"")+sec;
document.clckh.disp4.value=(hrs>=12)?"下午":"上午";
isn1=settimeout("isnclock()",1000);
isn2=true;
}
function isnarray()
{
argnr=isnarray.arguments.length
for(var i=0;
i<argnr;
i++)
{
this[i+1]=isnarray.arguments[i];
}
}
var isnmonths=new isnarray("1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月");
var isndays=new isnarray("星期一","星期二","星期三","星期四","星期五","星期六","星期日");isndays[0]="星期日";
//–>
</script>
<form name="clckh" onsubmit="0">
<table border="2">
<tr>
<td>时间</td>
<td><div align="center"><center><p>点</td>
<td align="center"><div align="center"><center><p>分</td>
<td align="center"><div align="center"><center><p>秒</td>
<td align="center"> </td>
</tr>
<tr align="center">
<td> </td>
<td valign="top"><input type="text" name="disp1" size="2"></td>
<td valign="top"><input type="text" name="disp2" size="2"></td>
<td valign="top"><input type="text" name="disp3" size="2"></td>
<td valign="top"><input type="text" name="disp4" size="3"></td>
</tr>
<script language="javascript">
<!–
var thisyear=today.getyear();
if (thisyear< 2000)
thisyear=1900+thisyear;
document.write("<tr><td>日期</td><td colspan=4>"
+isndays[today.getday()]+","+isnmonths[today.getmonth()+1]
+","+today.getdate()+"月," +thisyear+"年");
//–>
</script>
</table>
</form>