<div class="codetitle"> <span><a style="CURSOR: pointer" data="512" class="copybut" id="copybut512" onclick="doCopy('code512')"><u>复制代码</u></a></span> 代码如下:</div> <div class="codebody" id="code512"> <br><script language="JavaScript"> <br><!-- <BR>var bsYear; <BR>var bsDate; <BR>var bsWeek; <BR>var arrLen=8; //数组长度 <BR>var sValue=0; //当年的秒数 <BR>var dayiy=0; //当年第几天 <BR>var miy=0; //月份的下标 <BR>var iyear=0; //年份标记 <BR>var dayim=0; //当月第几天 <BR>var spd=86400; //每天的秒数 <br><br>var year1999="30;29;29;30;29;29;30;29;30;30;30;29"; //354 <BR>var year2000="30;30;29;29;30;29;29;30;29;30;30;29"; //354 <BR>var year2001="30;30;29;30;29;30;29;29;30;29;30;29;30"; //384 <BR>var year2002="30;30;29;30;29;30;29;29;30;29;30;29"; //354 <BR>var year2003="30;30;29;30;30;29;30;29;29;30;29;30"; //355 <BR>var year2004="29;30;29;30;30;29;30;29;30;29;30;29;30"; //384 <BR>var year2005="29;30;29;30;29;30;30;29;30;29;30;29"; //354 <BR>var year2006="30;29;30;29;30;30;29;29;30;30;29;29;30"; <br><br>var month1999="正月;二月;三月;四月;五月;六月;七月;八月;九月;十月;十一月;十二月" <BR>var month2001="正月;二月;三月;四月;闰四月;五月;六月;七月;八月;九月;十月;十一月;十二月" <BR>var month2004="正月;二月;闰二月;三月;四月;五月;六月;七月;八月;九月;十月;十一月;十二月" <BR>var month2006="正月;二月;三月;四月;五月;六月;七月;闰七月;八月;九月;十月;十一月;十二月" <BR>var Dn="初一;初二;初三;初四;初五;初六;初七;初八;初九;初十;十一;十二;十三;十四;十五;十六;十七;十八;十九;二十;廿一;廿二;廿三;廿四;廿五;廿六;廿七;廿八;廿九;三十"; <br><br>var Ys=new Array(arrLen); <BR>Ys[0]=919094400;Ys[1]=949680000;Ys[2]=980265600; <BR>Ys[3]=1013443200;Ys[4]=1044028800;Ys[5]=1074700800; <BR>Ys[6]=1107878400;Ys[7]=1138464000; <br><br>var Yn=new Array(arrLen); //农历年的名称 <BR>Yn[0]="己卯年";Yn[1]="庚辰年";Yn[2]="辛巳年"; <BR>Yn[3]="壬午年";Yn[4]="癸未年";Yn[5]="甲申年"; <BR>Yn[6]="乙酉年";Yn[7]="丙戌年"; <BR>var D=new Date(); <BR>var yy=D.getYear(); <BR>var mm=D.getMonth() 1; <BR>var dd=D.getDate(); <BR>var ww=D.getDay(); <BR>if (ww==0) ww="<font color=RED>星期日"; <br>if (ww==1) ww="星期一"; <br>if (ww==2) ww="星期二"; <br>if (ww==3) ww="星期三"; <br>if (ww==4) ww="星期四"; <br>if (ww==5) ww="星期五"; <br>if (ww==6) ww="<font color=RED>星期六"; <br>ww=ww; <br>var ss=parseInt(D.getTime() / 1000); <br>if (yy<100) yy="19" yy; <br><br>for (I=0;I<arrLen;I ) <BR> if (ss>=Ys[I])...{ <br> iyear=I; <br> sValue=ss-Ys[I]; //当年的秒数 <br> } <br>dayiy=parseInt(sValue/spd) 1; //当年的天数 <br><br>var dpm=year1999; <br>if (iyear==1) dpm=year2000; <br>if (iyear==2) dpm=year2001; <br>if (iyear==3) dpm=year2002; <br>if (iyear==4) dpm=year2003; <br>if (iyear==5) dpm=year2004; <br>if (iyear==6) dpm=year2005; <br>if (iyear==7) dpm=year2006; <br>dpm=dpm.split(";"); <br><br>var Mn=month1999; <br>if (iyear==2) Mn=month2001; <br>if (iyear==5) Mn=month2004; <br>if (iyear==7) Mn=month2006; <br>Mn=Mn.split(";"); <br><br>var Dn="初一;初二;初三;初四;初五;初六;初七;初八;初九;初十;十一;十二;十三;十四;十五;十六;十七;十八;十九;二十;廿一;廿二;廿三;廿四;廿五;廿六;廿七;廿八;廿九;三十"; <br>Dn=Dn.split(";"); <br><br>dayim=dayiy; <br><br>var total=new Array(13); <br>total[0]=parseInt(dpm[0]); <br>for (I=1;I<dpm.length-1;I ) total[I]=parseInt(dpm[I]) total[I-1]; <BR>for (I=dpm.length-1;I>0;I--) <br> if (dayim>total[I-1])...{ <br> dayim=dayim-total[I-1]; <br> miy=I; <br> }<br>bsWeek=ww; <br>bsDate=yy "年" mm "月"; <br>bsDate2=dd; <br>bsYear="农历" Yn[iyear]; <br>bsYear2=Mn[miy] Dn[dayim-1]; <br>if (ss>=Ys[7]||ss<ys>function CAL()...{ <br>document.write("<table border="1">document.write("<tr><td align='center'><b><font color=#008040>" bsDate "</font><br><font face ='Arial' size='6' color=#FF8040>" bsDate2 "</font><br><font color=#008040><span style='FONT-SIZE: 10.5pt'>" ); <br>document.write(bsWeek "</span><br>" "<br></b><font color=#9B4E00>"); <br>document.write(bsYear "<br>" bsYear2 "</td></tr></table>"); <br>} <br>//--> <br></脚本> <br> <script language="javascript">CAL();</script><br> </table></ys> </div>