<script>
function sj(){
var now = new Date();
var year = now.getFullYear(); //得到年份
var month = now.getMonth()+1;//得到月份
var date = now.getDate();//得到日期
var day = now.getDay();//得到周幾
var hour= now.getHours();//得到小時(shí)數(shù)
var minute= now.getMinutes();//得到分鐘數(shù)
var second= now.getSeconds();//得到秒數(shù)
var xq=["日","一","二","三","四","五","六"];
time=year+'年' +month+'月' +date+'日'+'星期'+xq[day]+ hour+'時(shí)' +minute+'分' +second+'秒';
document.getElementById("time").innerHTML=time;
return sj;
}
setInterval("sj()",1000);
</script>