日期星期读取,格式:2006年6月12日 星期一
<SCRIPT language=JavaScript>
//程序作用:日期星期读取
//编写日期:2007年7月15号
//编写人员:ln
//测试人员:ln
function Curdate()
{
var today=new Date();
if ( today.getYear() <= 99 )
yearStr=today.getYear() + 1900;
else
yearStr=today.getYear();
monthStr=today.getMonth()+1;
dateStr=today.getDate();
weekVal=today.getDay();
if (weekVal==0)
msg1="星期日";
else if (weekVal==1)
msg1="星期一";
else if (weekVal==2)
msg1="星期二";
else if (weekVal==3)
msg1="星期三";
else if (weekVal==4)
msg1="星期四";
else if (weekVal==5)
msg1="星期五";
else if (weekVal==6)
msg1="星期六";
msg=yearStr+"年"+monthStr+"月"+dateStr+"日 "+msg1;
return msg;
}
function Curdate2()
{
var today=new Date();
if ( today.getYear() <= 99 )
yearStr=today.getYear() + 1900;
else
yearStr=today.getYear();
monthStr=today.getMonth()+1;
dateStr=today.getDate();
weekVal=today.getDay();
msg=yearStr+"."+monthStr+"."+dateStr;
return msg;
}
//-->
</SCRIPT>
<SCRIPT language=JavaScript>
<!--
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="";
function getFullYear(d)
{
yr=d.getYear();if(yr<1000)
yr+=1900;return yr;}
document.write("<table border=0 align=center cellpadding=0 cellspacing=0>");
//下面各行分别是一种风格,把不需要的删掉即可
document.write("<TR><TD height=18>"+getFullYear(today)+"年"+isnMonths[today.getMonth()]+""+today.getDate()+"日 "+isnDays[today.getDay()]+"");
document.write("</td></tr></table>");
//-->
</SCRIPT>