1.<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 2.<html xmlns="http://www.w3.org/1999/xhtml"> 3.<head> 4.<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 5.<title>无标题文档</title> 6.<mce:script type="text/javascript"><!-- 7.<!-- 8.function startTime() 9.{ 10.var today=new Date() 11.var years=today.getFullYear(); 12.var months=today.getMonth(); 13.var d=today.getDate() 14.var h=today.getHours() 15.var m=today.getMinutes() 16.var s=today.getSeconds() 17.// add a zero in front of numbers<10 18.monthsmonths=months+1 19.months=checkTime(months) 20.d=checkTime(d) 21.m=checkTime(m) 22.s=checkTime(s) 23.var weekday=new Array(7) 24.weekday[0]="星期日" 25.weekday[1]="星期一" 26.weekday[2]=" 星期二" 27.weekday[3]="星期三" 28.weekday[4]="星期四" 29.weekday[5]="星期五" 30.weekday[6]=" 星期六" 31.var w=weekday[today.getDay()] 32.document.getElementById('ShowTime').innerHTML=years+" 年"+months+"月"+d+"日 "+w+" "+h+":"+m+":"+s; 33.t=setTimeout('startTime()',500) 34.} 35.function checkTime(i) 36.{ 37.if (i<10) 38. {i="0" + i} 39. return i 40.} 41.--> 42. // --></mce:script> 43.</head> 44. 45.<body οnlοad="startTime()"> 46.<div id="ShowTime"></div> 47.</body> 48.</html