查看样式: | 多种经典实用查询工具 |
显示日期代码1:
<SCRIPT LANGUAGE="JavaScript" TYPE="text/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(year+"年"+mymonth+"月"+myday+"日 "+weekday); </SCRIPT>
显示日期代码2: <style>.ttt{font-size:9pt;font-family: 宋体;color:#00ff00}</style> <script language=JavaScript>today=new Date();function initArray()
{this.length=initArray.arguments.length;for(var i=0;i<this.length;i++) this[i+1]=initArray.arguments[i]};var d=new
initArray("星期日", "星期一","星期二", "星期三","星期四","星期五","星期
六");document.write("<font class=ttt>",today.getYear
(),"年",today.getMonth()+1,"月", today.getDate(),"日 ", d[today.getDay()+1],"</font>");</script>
显示时间日期代码3: <script language="JavaScript1.2"> <!--hide var isnMonth = new Array("1月","2月","3月","4月","5月","6月","7月","8月","9月","10
月","11月","12月"); var isnDay = new Array("星期日","星期一","星期二","星期三","星期四","星期五","星期
六","星期日"); today = new Date () ; Year=today.getYear(); Date=today.getDate(); if (document.all) document.title="欢迎你,今天是: "+Year+"年"+isnMonth
[today.getMonth()]+Date+"日"+isnDay[today.getDay()] //--hide--> </script>
(中华企业文化网)
|