dw时间代码怎么写( 二 )

<100) yyyy+=1900; if ((yyyy < 1997) || (yyyy> 2020)){ return 0; } Bytes[0] = CnData[(yyyy - 1997) * 4]; Bytes[1] = CnData[(yyyy - 1997) * 4 + 1]; Bytes[2] = CnData[(yyyy - 1997) * 4 + 2]; Bytes[3] = CnData[(yyyy - 1997) * 4 + 3]; if ((Bytes[0] & 0x80) != 0) {CnMonth[0] = 12;} else {CnMonth[0] = 11;} CnBeginDay = (Bytes[0] & 0x7f); CnMonthData = http://www.xuexi88.com/zhishi/Bytes[1]; CnMonthData = CnMonthData << 8; CnMonthData = CnMonthData | Bytes[2]; LeapMonth = Bytes[3];for (I=15;I>=0;I--){ CnMonthDays[15 - I] = 29; if (((1 << I) & CnMonthData) != 0 ){ CnMonthDays[15 - I]++;} if (CnMonth[15 - I] == LeapMonth ){ CnMonth[15 - I + 1] = - LeapMonth;} else{ if (CnMonth[15 - I] < 0 ){CnMonth[15 - I + 1] = - CnMonth[15 - I] + 1;} else {CnMonth[15 - I + 1] = CnMonth[15 - I] + 1;} if (CnMonth[15 - I + 1] > 12 ){ CnMonth[15 - I + 1] = 1;} } } DaysCount = DaysNumberofDate(DateGL) - 1; if (DaysCount <= (CnMonthDays[0] - CnBeginDay)){ if ((yyyy > 1901) && (CnDateofDate(new Date((yyyy - 1)+"/12/31")) < 0)){ ResultMonth = - CnMonth[0];} else {ResultMonth = CnMonth[0];} ResultDay = CnBeginDay + DaysCount; } else{ CnDaysCount = CnMonthDays[0] - CnBeginDay; I = 1; while ((CnDaysCount < DaysCount) && (CnDaysCount + CnMonthDays[I] < DaysCount)){ CnDaysCount+= CnMonthDays[I]; I++; } ResultMonth = CnMonth[I]; ResultDay = DaysCount - CnDaysCount; } if (ResultMonth > 0){ return ResultMonth * 100 + ResultDay;} else{return ResultMonth * 100 - ResultDay;}}function CnYearofDate(DateGL){var YYYY=DateGL.getYear();var MM=DateGL.getMonth()+1;var CnMM=parseInt(Math.abs(CnDateofDate(DateGL))/100);if(YYYY<100) YYYY+=1900;if(CnMM>MM) YYYY--;YYYY-=1864;return CnEra(YYYY)+"年";}function CnMonthofDate(DateGL){var CnMonthStr=new Array("零","正","二","三","四","五","六","七","八","九","十","冬","腊");var Month; Month = parseInt(CnDateofDate(DateGL)/100); if (Month < 0){return "闰" + CnMonthStr[-Month] + "月";} else{return CnMonthStr[Month] + "月";}}function CnDayofDate(DateGL){var CnDayStr=new Array("零","初一","初二","初三","初四","初五","初六","初七","初八","初九","初十","十一","十二","十三","十四","十五","十六","十七","十八","十九","二十","廿一","廿二","廿三","廿四","廿五","廿六","廿七","廿八","廿九","三十");var Day; Day = (Math.abs(CnDateofDate(DateGL)))%100; return CnDayStr[Day];}function DaysNumberofMonth(DateGL){var MM1=DateGL.getYear(); MM1<100 ? MM1+=1900:MM1;var MM2=MM1; MM1+="/"+(DateGL.getMonth()+1); MM2+="/"+(DateGL.getMonth()+2); MM1+="/1"; MM2+="/1";return parseInt((Date.parse(MM2)-Date.parse(MM1))/86400000);}function CnEra(YYYY){var Tiangan=new Array("甲","乙","丙","丁","戊","己","庚","辛","壬","癸");//var Dizhi=new Array("子(鼠)","丑(牛)","寅(虎)"," 。
7.Dreamweaver中怎样添加显示时间日期用以下JS代码即可
<script language="javascript">
<!--
today=new Date();
var week; var date;
if(today.getDay()==0) week="星期日"
if(today.getDay()==1) week="星期一"
if(today.getDay()==2) week="星期二"
if(today.getDay()==3) week="星期三"
if(today.getDay()==4) week="星期四"
if(today.getDay()==5) week="星期五"
if(today.getDay()==6) week="星期六"
date=(today.getYear())+"年"+(today.getMonth()+1)+"月"+today.getDate()+"日"+" "
document.write(date+week);
// -->
</script>
【dw时间代码怎么写】

dw时间代码怎么写

文章插图