八种风格的日期时间显示格式
脚本说明:
第一步:把如下代码加入区域中
function initArray(){for(i=0;i this[i]=initArray.arguments[i];}var isnMonths=new initArray("1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月");var isnDays=new initArray("星期日","星期一","星期二","星期三","星期四","星期五","星期六","星期日");today=new Date();hrs=today.getHours();min=today.getMinutes();sec=today.getSeconds();clckh=""+((hrs>12)?hrs-12:hrs);
clckm=((min
//-->
第二步:把如下代码加入区域中
function getFullYear(d){//d is a date object
yr=d.getYear();if(yr yr+=1900;return yr;}document.write("");//don't delete this line
/* 每一段代表一种风格,不需要的删除即可*/
document.write("风格一"+isnDays[today.getDay()]
+","+isnMonths[today.getMonth()]+""+today.getDate()+"日,"
+getFullYear(today)+"年");document.write("风格二"+clckh+":"+clckm
+":"+clcks+""+clck+"");document.write("风格三"
+isnDays[today.getDay()]+","+isnMonths[today.getMonth()]+""
+today.getDate()+"日,"+getFullYear(today)+"年 "+clckh+":"+clckm+":"
+clcks+""+clck+"");document.write("风格四"
+(today.getMonth()+1)+"/"+today.getDate()+"/"
+(getFullYear(today)+"").substring(2,4)+"");document.write("风格五:"+hrs+":"+clckm+":"+clcks+"");document.write("风格六:"+today+"");document.write("风格七"+navigator.appName+"");document.write("风格八:"+navigator.appVersion+"");document.write(""); // don't delete this line
//-->