冰枫逸范
Victory won’t come to me unless I go to it. 胜利是不会向我走来的,我必须自己走向胜利。

放在页首里:

<Script language="JavaScript">
var enabled = 0; today = new Date();
var day; var date;
if(today.getDay()==0) day = "星期日 "
if(today.getDay()==1) day = "星期一 "
if(today.getDay()==2) day = "星期二 "
if(today.getDay()==3) day = "星期三 "
if(today.getDay()==4) day = "星期四 "
if(today.getDay()==5) day = "星期五 "
if(today.getDay()==6) day = "星期六 "
document.fgColor = " FF0072";
date1 =(today.getYear()) + "年" + (today.getMonth() + 1 ) + "月" + today.getDate() + "日 " ;
date2 = day ;
document.write(date1.fontsize(2));
document.write(date2.fontsize(2));
document.write("<span id='clock'></span>");
var now,hours,minutes,seconds,timeValue;
function showtime(){
now = new Date();
hours = now.getHours();
minutes = now.getMinutes();
seconds = now.getSeconds();
timeValue = (hours >= 12) ? "下午 " : "上午 ";
timeValue += hours+ ":";
timeValue += ((minutes < 10) ? "0" : "") + minutes + ":";
timeValue += ((seconds < 10) ? "0" : "") + seconds + "";
clock.innerHTML = timeValue;
setTimeout("showtime()",100);
}
showtime();
</Script>

posted on 2008-04-04 17:18 冰枫逸范 阅读(1599) 评论(1)  编辑  收藏 所属分类: 博客技巧

FeedBack:
# re: 显示当前时间代码
2008-12-11 09:10 | 感恩人
xiexie.我用了你的代码   回复  更多评论
  

只有注册用户登录后才能发表评论。


网站导航: