胃仙-U 发表于 2003 年 3 月 8 日 00:00:00

主页自动更新时间代码!!![原创]


有人见到这个人请通知我:非常感谢!
UploadFile/20033823244644058.jpg




主页自动更新时间代码(简而明了)颜色默认红色,可以自行改动!!!

跟贴就OK了,非常简便!!!

<SCRIPT language=JavaScript>
<!---
today=new Date();
var hours = today.getHours();
var minutes = today.getMinutes();
var seconds = today.getSeconds();
var timeValue = "<FONT COLOR=#99cc33>" + ((hours >12) ? hours -12 :hours); timeValue += ((minutes < 10) ? "<BLINK><FONT COLOR=#99cc33>:</FONT></BLINK>0" : "<BLINK><FONT COLOR=#99cc33>:</FONT></BLINK>") + minutes+"</FONT></FONT>";
timeValue += (hours >= 12) ? "<FONT COLOR=#99cc33><I><B>pm</B></I></FONT>" : "<FONT COLOR=#99cc33><B><I>am</I></B></FONT>";
function initArray(){
this.length=initArray.arguments.length
for(var i=0;i<this.length;i++)
this=initArray.arguments}
var d=new initArray("<font color=RED>星期日","<font color=#333300>星期一","<font color=#333300>星期二","<font color=#333300>星期三","<font color=#333300>星期四","<font color=#333300>星期五","<font color=red>星期六"); document.write("<font color=#333300>",today.getYear(),"<font color=#333300>年","<font color=#333300>",today.getMonth()+1,"<font color=#333300>月","<font color=#333300>",today.getDate(),"<font color=#333300>日 </FONT>",d," ",timeValue);//-->
</SCRIPT>




<SCRIPT language=JavaScript>
var day="";
var month="";
var ampm="";
var ampmhour="";
var myweekday="";
var year="";
mydate=new Date();
myweekday=mydate.getDay();
mymonth=mydate.getMonth()+1;
myday= mydate.getDate();
myyear= mydate.getYear();
year=(myyear > 200) ? myyear : 1900 + myyear;
if(myweekday == 0)
weekday=" 星期日 ";
else if(myweekday == 1)
weekday=" 星期一 ";
else if(myweekday == 2)
weekday=" 星期二 ";
else if(myweekday == 3)
weekday=" 星期三 ";
else if(myweekday == 4)
weekday=" 星期四 ";
else if(myweekday == 5)
weekday=" 星期五 ";
else if(myweekday == 6)
weekday=" 星期六 ";
document.write("<font color=#ff0000>今天是 "+year+"年"+mymonth+"月"+myday+"日 "+weekday+"</font>");
</SCRIPT>
[此贴子已经被作者于2003-3-9 0:34:07编辑过]
页: [1]
查看完整版本: 主页自动更新时间代码!!![原创]