<script language="JavaScript">
<!--
function check(val){
if (val<10){
return("0"+val);
}else{
return(val);
}
}
function ShowTime()
{
var date=new Date();
var year=date.getFullYear();
var month=date.getMonth()+1;
var day=date.getDate();
var hour=date.getHours();
var minutes=date.getMinutes();
var second=date.getSeconds();
var timestr=year+"-"+ month+"-"+ day+ " " + +check(hour)+":"+check(minutes)+":"+check(second);
document.getElementById("stime").innerText=timestr;
var timerID=setTimeout('ShowTime();',1000);
}
//或者 在Firefox
function ShowTime()
{
var date=new Date();
var year=date.getFullYear();
var month=date.getMonth()+1;
var day=date.getDate();
var hour=date.getHours();
var minutes=date.getMinutes();
var second=date.getSeconds();
var timestr=year+"-"+ month+"-"+ day+ " " + +check(hour)+":"+check(minutes)+":"+check(second);
var sTime =document.getElementById("stime");
var childs= sTime.childNodes;
for(var i=childs.length;i--;i>0){
sTime.removeChild(childs[i]);
}
var txt = document.createTextNode(timestr);
sTime.appendChild(txt);
var timerID=setTimeout('ShowTime();',1000);
}
//-->
</script>
<script type="text/javascript"> </script>
<script type="text/javascript"> </script>