看到114百事通首页的时间,感觉挺好的,不过是获取客户端的,明天就是51了。呵呵,不是51.com哦。我加了 “年”份 进去,希望学习有所收获。代码如下: < head > < meta http-equiv ="Content-Type" content ="text/html; charset=gb2312" > </ head > < body > <!-- οnlοad=javascript:document.form.kw.focus(); 不要 --> <!-- <SPAN id=localtime></SPAN> 自己设定位置 --> < p id ="localtime" ></ p > < SCRIPT > ... function showLocale(objD) ...{ var dn, str; var yy = objD.getYear(); var hh = objD.getHours(); var mm = objD.getMinutes(); var ss = objD.getSeconds(); str =objD.getYear() + "年" + (objD.getMonth() + 1) + "月" + objD.getDate() +"日"; if(hh<10) hh = '0' + hh; if(mm<10) mm = '0' + mm; if(ss<10) ss = '0' + ss; str += hh + ":" + mm + ":" + ss; return(str);}function tick() ...{ var today; today = new Date(); document.getElementById("localtime").innerHTML = showLocale(today); window.setTimeout("tick()", 1000);}tick(); </ script > </ body >