网上网-网页日期代码(带农历)

网页日期代码

带农历的日期代码

<script&nbsp;language="JavaScript">&nbsp; 
<!--&nbsp;
var&nbsp;bsYear;&nbsp;
var&nbsp;bsDate;&nbsp;
var&nbsp;bsWeek;&nbsp;
var&nbsp;arrLen=8;&nbsp;//数组长度&nbsp;
var&nbsp;sValue=0;&nbsp;//当年的秒数&nbsp;
var&nbsp;dayiy=0;&nbsp;//当年第几天&nbsp;
var&nbsp;miy=0;&nbsp;//月份的下标&nbsp;
var&nbsp;iyear=0;&nbsp;//年份标记&nbsp;
var&nbsp;dayim=0;&nbsp;//当月第几天&nbsp;
var&nbsp;spd=86400;&nbsp;//每天的秒数&nbsp;
var&nbsp;year1999="30;29;29;30;29;29;30;29;30;30;30;29";&nbsp;//354&nbsp;
var&nbsp;year2000="30;30;29;29;30;29;29;30;29;30;30;29";&nbsp;//354&nbsp;
var&nbsp;year2001="30;30;29;30;29;30;29;29;30;29;30;29;30";&nbsp;//384&nbsp;
var&nbsp;year2002="30;30;29;30;29;30;29;29;30;29;30;29";&nbsp;//354&nbsp;
var&nbsp;year2003="30;30;29;30;30;29;30;29;29;30;29;30";&nbsp;//355&nbsp;
var&nbsp;year2004="29;30;29;30;30;29;30;29;30;29;30;29;30";&nbsp;//384&nbsp;
var&nbsp;year2005="29;30;29;30;29;30;30;29;30;29;30;29";&nbsp;//354&nbsp;
var&nbsp;year2006="30;29;30;29;30;30;29;29;30;30;29;29;30";&nbsp;
var&nbsp;month1999="正月;二月;三月;四月;五月;六月;七月;八月;九月;十月;十一月;十二月"&nbsp;
var&nbsp;month2001="正月;二月;三月;四月;闰四月;五月;六月;七月;八月;九月;十月;十一月;十二月"&nbsp;
var&nbsp;month2004="正月;二月;闰二月;三月;四月;五月;六月;七月;八月;九月;十月;十一月;十二月"&nbsp;
var&nbsp;month2006="正月;二月;三月;四月;五月;六月;七月;闰七月;八月;九月;十月;十一月;十二月"&nbsp;
var&nbsp;Dn="初一;初二;初三;初四;初五;初六;初七;初八;初九;初十;十一;十二;十三;十四;十五;十六;十七;十八;十九;二十;廿一;廿二;廿三;廿四;廿五;廿六;廿七;廿八;廿九;三十";&nbsp;
var&nbsp;Ys=new&nbsp;Array(arrLen);&nbsp;
Ys[0]=919094400;Ys[1]=949680000;Ys[2]=980265600;&nbsp;
Ys[3]=1013443200;Ys[4]=1044028800;Ys[5]=1074700800;&nbsp;
Ys[6]=1107878400;Ys[7]=1138464000;&nbsp;
var&nbsp;Yn=new&nbsp;Array(arrLen);&nbsp;//农历年的名称&nbsp;
Yn[0]="己卯年";Yn[1]="庚辰年";Yn[2]="辛巳年";&nbsp;
Yn[3]="壬午年";Yn[4]="癸未年";Yn[5]="甲申年";&nbsp;
Yn[6]="乙酉年";Yn[7]="丙戌年";&nbsp;
var&nbsp;D=new&nbsp;Date();&nbsp;
var&nbsp;yy=D.getYear();&nbsp;
var&nbsp;mm=D.getMonth()+1;&nbsp;
var&nbsp;dd=D.getDate();&nbsp;
var&nbsp;ww=D.getDay();&nbsp;
if&nbsp;(ww==0)&nbsp;ww="<font&nbsp;color=RED>星期日";&nbsp;
if&nbsp;(ww==1)&nbsp;ww="星期一";&nbsp;
if&nbsp;(ww==2)&nbsp;ww="星期二";&nbsp;
if&nbsp;(ww==3)&nbsp;ww="星期三";&nbsp;
if&nbsp;(ww==4)&nbsp;ww="星期四";&nbsp;
if&nbsp;(ww==5)&nbsp;ww="星期五";&nbsp;
if&nbsp;(ww==6)&nbsp;ww="<font&nbsp;color=RED>星期六";&nbsp;
ww=ww;&nbsp;
var&nbsp;ss=parseInt(D.getTime()&nbsp;/&nbsp;1000);&nbsp;
if&nbsp;(yy<100)&nbsp;yy="19"+yy;&nbsp;
for&nbsp;(i=0;i<arrLen;i++)&nbsp;
if&nbsp;(ss>=Ys[i]){&nbsp;
iyear=i;&nbsp;
sValue=ss-Ys[i];&nbsp;//当年的秒数&nbsp;
}&nbsp;
dayiy=parseInt(sValue/spd)+1;&nbsp;//当年的天数&nbsp;
var&nbsp;dpm=year1999;&nbsp;
if&nbsp;(iyear==1)&nbsp;dpm=year2000;&nbsp;
if&nbsp;(iyear==2)&nbsp;dpm=year2001;&nbsp;
if&nbsp;(iyear==3)&nbsp;dpm=year2002;&nbsp;
if&nbsp;(iyear==4)&nbsp;dpm=year2003;&nbsp;
if&nbsp;(iyear==5)&nbsp;dpm=year2004;&nbsp;
if&nbsp;(iyear==6)&nbsp;dpm=year2005;&nbsp;
if&nbsp;(iyear==7)&nbsp;dpm=year2006;&nbsp;
dpm=dpm.split(";");&nbsp;
var&nbsp;Mn=month1999;&nbsp;
if&nbsp;(iyear==2)&nbsp;Mn=month2001;&nbsp;
if&nbsp;(iyear==5)&nbsp;Mn=month2004;&nbsp;
if&nbsp;(iyear==7)&nbsp;Mn=month2006;&nbsp;
Mn=Mn.split(";");&nbsp;
var&nbsp;Dn="初一;初二;初三;初四;初五;初六;初七;初八;初九;初十;十一;十二;十三;十四;十五;十六;十七;十八;十九;二十;廿一;廿二;廿三;廿四;廿五;廿六;廿七;廿八;廿九;三十";&nbsp;
Dn=Dn.split(";");&nbsp;
dayim=dayiy;&nbsp;
var&nbsp;total=new&nbsp;Array(13);&nbsp;
total[0]=parseInt(dpm[0]);&nbsp;
for&nbsp;(i=1;i<dpm.length-1;i++)&nbsp;total[i]=parseInt(dpm[i])+total[i-1];&nbsp;
for&nbsp;(i=dpm.length-1;i>0;i--)&nbsp;
if&nbsp;(dayim>total[i-1]){&nbsp;
dayim=dayim-total[i-1];&nbsp;
miy=i;&nbsp;
}&nbsp;
bsWeek=ww;&nbsp;
bsDate=yy+"年"+mm+"月";&nbsp;
bsDate2=dd+"日";&nbsp;
bsYear="农历"+Yn[iyear];&nbsp;
bsYear2=Mn[miy]+Dn[dayim-1];&nbsp;
if&nbsp;(ss>=Ys[7]||ss<Ys[0])&nbsp;bsYear=Yn[7];&nbsp;
function&nbsp;CAL(){&nbsp;
document.write(bsDate+bsDate2+"&nbsp;"+bsWeek+"&nbsp;"+bsYear+"&nbsp;"+bsYear2);&nbsp;
}&nbsp;
//-->&nbsp; 
</script>&nbsp; 
<script&nbsp;language="javascript">CAL();</script>

 

不带农历的带时间的日期代码(好看方框)

<SCRIPT language=JavaScript>
function Year_Month(){ 
var now = new Date(); 
var yy = now.getYear(); 
var mm = now.getMonth()+1; 
var cl = '<font color="#0000df">'; 
if (now.getDay() == 0) cl = '<font color="#c00000">'; 
if (now.getDay() == 6) cl = '<font color="#00c000">'; 
return(cl + yy + '年' + mm + '月</font>'); }
function Date_of_Today(){ 
var now = new Date(); 
var cl = '<font color="#ff0000">'; 
if (now.getDay() == 0) cl = '<font color="#c00000">'; 
if (now.getDay() == 6) cl = '<font color="#00c000">'; 
return(cl + now.getDate() + '</font>'); }
function Day_of_Today(){ 
var day = new Array(); 
day[0] = "星期日"; 
day[1] = "星期一"; 
day[2] = "星期二"; 
day[3] = "星期三"; 
day[4] = "星期四"; 
day[5] = "星期五"; 
day[6] = "星期六"; 
var now = new Date(); 
var cl = '<font color="#0000df">'; 
if (now.getDay() == 0) cl = '<font color="#c00000">'; 
if (now.getDay() == 6) cl = '<font color="#00c000">'; 
return(cl + day[now.getDay()] + '</font>'); }
function CurentTime(){ 
var now = new Date(); 
var hh = now.getHours(); 
var mm = now.getMinutes(); 
var ss = now.getTime() % 60000; 
ss = (ss - (ss % 1000)) / 1000; 
var clock = hh+':'; 
if (mm < 10) clock += '0'; 
clock += mm+':'; 
if (ss < 10) clock += '0'; 
clock += ss; 
return(clock); } 
function refreshCalendarClock(){ 
document.all.calendarClock1.innerHTML = Year_Month(); 
document.all.calendarClock2.innerHTML = Date_of_Today(); 
document.all.calendarClock3.innerHTML = Day_of_Today(); 
document.all.calendarClock4.innerHTML = CurentTime(); }
var webUrl = webUrl; 
document.write('<table border="0" cellpadding="0" cellspacing="0"><tr><td>'); 
document.write('<table id="CalendarClockFreeCode" border="0" cellpadding="0" cellspacing="0" width="60" height="70" ');
document.write('style="position:absolute;visibility:hidden" bgcolor="#eeeeee">');
document.write('<tr><td align="center"><font ');
document.write('style="cursor:hand;color:#ff0000;font-family:宋体;font-size:14pt;line-height:120%" ');
if (webUrl != 'netflower'){ 
document.write('</td></tr><tr><td align="center"><font ');
document.write('style="cursor:hand;color:#2000ff;font-family:宋体;font-size:9pt;line-height:110%" ');

document.write('</td></tr></table>'); 
document.write('<table border="0" cellpadding="0" cellspacing="0" width="61" bgcolor="#C0C0C0" height="70">');
document.write('<tr><td valign="top" width="100%" height="100%">');
document.write('<table border="1" cellpadding="0" cellspacing="0" width="58" bgcolor="#FEFEEF" height="67">');
document.write('<tr><td align="center" width="100%" height="100%" >');
document.write('<font id="calendarClock1" style="font-family:宋体;font-size:7pt;line-height:120%"> </font><br>');
document.write('<font id="calendarClock2" style="color:#ff0000;font-family:Arial;font-size:14pt;line-height:120%"> </font><br>');
document.write('<font id="calendarClock3" style="font-family:宋体;font-size:9pt;line-height:120%"> </font><br>');
document.write('<font id="calendarClock4" style="color:#100080;font-family:宋体;font-size:8pt;line-height:120%"><b> </b></font>');
document.write('</td></tr></table>');
document.write('</td></tr></table>'); 
document.write('</td></tr></table>'); 
setInterval('refreshCalendarClock()',1000);
</SCRIPT>

 

设为首页

关于我们 新闻公告 客户服务 办理汇款 联系方法 本站招聘 过客留言 代理合作

QQ:2873342  MSN:zhishenggang@hotmail.com  E-MAIL:webmaster@163666.com

Copyright ©2003-2008 www.163666.com All rights reserved

真诚感谢: 中国新网 中华企业网 百度搜索 卓越网 太极链

 网上网版权所有  浙ICP备05066679号