<script language="javascript" type="text/javascript">
var now = "";
function showTime()
{
var date = new Date();
now = date.getFullYear()+"年";
now = now +(date.getMonth()+1)+"月";
now = now +(date.getDate())+"日 ";
if(date.getDay()==1) now=now+"星期一 "
if(date.getDay()==2) now=now+"星期二 "
if(date.getDay()==3) now=now+"星期三 "
if(date.getDay()==4) now=now+"星期四 "
if(date.getDay()==5) now=now+"星期五 "
if(date.getDay()==6) now=now+"星期六 "
if(date.getDay()==0) now=now+"星期日 "
now = now +(date.getHours())+"时";
now = now +(date.getMinutes())+"分";
now = now +date.getSeconds()+"秒";
document.getElementById("nowDiv").innerHTML = now;
setTimeout("showTime()",1000);
}
</script>
下面为引用js部分
<div id = "nowDiv"></div>