八种风格的时间日期

!-- 第 1 步: -- !-- 把下面的代码加到HEAD/HEAD区域中: -- SCRIPT language=gt;!-- function initArray(){for(i=0;iinitArray.arguments.length;i++) this

<!– 第 1 步: –>
<!– 把下面的代码加到<HEAD></HEAD>区域中: –>

<SCRIPT language=&#106avascript author=luxiaoqing><!–
function initArray(){for(i=0;i<initArray.arguments.length;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<10)?”0″:””)+min;clcks=((sec<10)?”0″:””)+sec;clck=(hrs>=12)?”下午”:”上午”;var stnr=””;var ns=”0123456789″;var a=””;

//–>

</SCRIPT>

 


<!– 第 2 步: –>
<!– 把下面的代码加到<BODY></BODY>区域中: –>

<SCRIPT language=&#106avascript><!–
function getFullYear(d){//d is a date object
yr=d.getYear();if(yr<1000)
yr+=1900;return yr;}document.write(“<table width=486>”);//don’t delete this line

/* 每一段代表一种风格,不需要的删除即可*/

document.write(“<TR><TD VALIGN=TOP><P>风格一<P></TD><TD VALIGN=TOP>”+isnDays[today.getDay()]
+”,”+isnMonths[today.getMonth()]+””+today.getDate()+”日,”
+getFullYear(today)+”年<P>”);document.write(“<TR><TD VALIGN=TOP>风格二<P></TD><TD VALIGN=TOP>”+clckh+”:”+clckm
+”:”+clcks+””+clck+”<P></TD></TR>”);document.write(“<TR><TD VALIGN=TOP>风格三<P></TD><TD VALIGN=TOP>”
+isnDays[today.getDay()]+”,”+isnMonths[today.getMonth()]+””
+today.getDate()+”日,”+getFullYear(today)+”年 “+clckh+”:”+clckm+”:”
+clcks+””+clck+”<P></TD></TR>”);document.write(“<TR><TD VALIGN=TOP>风格四<P></TD><TD VALIGN=TOP>”
+(today.getMonth()+1)+”/”+today.getDate()+”/”
+(getFullYear(today)+””).substring(2,4)+”<P></TD></TR>”);document.write(“<TR><TD VALIGN=TOP>风格五:<P></TD><TD VALIGN=TOP>”+hrs+”:”+clckm+”:”+clcks+”<P></TD></TR>”);document.write(“<TR><TD VALIGN=TOP>风格六:<P></TD><TD>”+today+”<P></TD></TR>”);document.write(“<TR><TD VALIGN=TOP>风格七<P></TD><TD>”+navigator.appName+”<P></TD></TR>”);document.write(“<TR><TD VALIGN=TOP>风格八:<P></TD><TD VALIGN=TOP>”+navigator.appVersion+”<P></TD></TR>”);document.write(“</table>”); // don’t delete this line
//–>

</SCRIPT>

给TA打赏
共{{data.count}}人
人已打赏
其他教程

全中文日期显示

2006-3-3 1:45:00

其他教程

导航效果的制作方法

2006-3-5 5:49:00

0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
有新私信 私信列表
搜索