网上有许多类似的代码,比如网站:hao123,ip138、日梭万年历网络版 等等,不过日梭万年历相对比较全面,也可以看看另外一篇文章的教程:
下面的代码是从hao123网站上摘取的,把以下代码保存到记事本,修改扩展名为html,双击打开就可以看到效果.
<!doCTYpE html puBLiC "-//w3C//dTd xHTML 1.0 strict//En" "http://www.w3.org/TR/xhtml1/dTd/xhtml1-strict.dtd">
<!-- saved from url=(0014)about:internet -->
<html>
<head>
<meta http-equiv=Content-Type content="text/html; charset=gb2312">
<title>hao123万年历</title>
<meta content="hao123万年历" name=keywords>
<meta content=All name=robots>
<meta content="hao123万年历" name=description>
<meta http-equiv="x-ua-compatible" content="ie=7"/>
<style type="text/css">
p {fonT-FAMiLY: 宋体; FonT-siZE: 9pt;line-height:12pt:color:#000000}
Td {fonT-FAMiLY: 宋体,simsun; FonT-siZE: 9pt}
a:link{ color:#000000; text-decoration:none}
a:visited{CoLoR: #000000; TExT-dECoRATion: none}
a:active{color:green;text-decoration:none}
a:hover{color:red;text-decoration:underline}
button{width:39px;height:21px;padding:2px;}
</style>
<script language=Javascript>
<!--
var blnsummerTime = false;
/*****************************************************************************
日期资料
*****************************************************************************/
var lunarinfo=new Array(
0x04bd8,0x04ae0,0x0a570,0x054d5,0x0d260,0x0d950,0x16554,0x056a0,0x09ad0,0x055d2,
0x04ae0,0x0a5b6,0x0a4d0,0x0d250,0x1d255,0x0b540,0x0d6a0,0x0ada2,0x095b0,0x14977,
0x04970,0x0a4b0,0x0b4b5,0x06a50,0x06d40,0x1ab54,0x02b60,0x09570,0x052f2,0x04970,
0x06566,0x0d4a0,0x0ea50,0x06e95,0x05ad0,0x02b60,0x186e3,0x092e0,0x1c8d7,0x0c950,
0x0d4a0,0x1d8a6,0x0b550,0x056a0,0x1a5b4,0x025d0,0x092d0,0x0d2b2,0x0a950,0x0b557,
0x06ca0,0x0b550,0x15355,0x04da0,0x0a5b0,0x14573,0x052b0,0x0a9a8,0x0e950,0x06aa0,
0x0aea6,0x0ab50,0x04b60,0x0aae4,0x0a570,0x05260,0x0f263,0x0d950,0x05b57,0x056a0,
0x096d0,0x04dd5,0x04ad0,0x0a4d0,0x0d4d4,0x0d250,0x0d558,0x0b540,0x0b6a0,0x195a6,
0x095b0,0x049b0,0x0a974,0x0a4b0,0x0b27a,0x06a50,0x06d40,0x0af46,0x0ab60,0x09570,
0x04af5,0x04970,0x064b0,0x074a3,0x0ea50,0x06b58,0x055c0,0x0ab60,0x096d5,0x092e0,
0x0c960,0x0d954,0x0d4a0,0x0da50,0x07552,0x056a0,0x0abb7,0x025d0,0x092d0,0x0cab5,
0x0a950,0x0b4a0,0x0baa4,0x0ad50,0x055d9,0x04ba0,0x0a5b0,0x15176,0x052b0,0x0a930,
0x07954,0x06aa0,0x0ad50,0x05b52,0x04b60,0x0a6e6,0x0a4e0,0x0d260,0x0ea65,0x0d530,
0x05aa0,0x076a3,0x096d0,0x04bd7,0x04ad0,0x0a4d0,0x1d0b6,0x0d250,0x0d520,0x0dd45,
0x0b5a0,0x056d0,0x055b2,0x049b0,0x0a577,0x0a4b0,0x0aa50,0x1b255,0x06d20,0x0ada0,
0x14b63);
var solarMonth=new Array(31,28,31,30,31,30,31,31,30,31,30,31);
var Gan=new Array("甲","乙","丙","丁","戊","己","庚","辛","壬","癸");
var Zhi=new Array("子","丑","寅","卯","辰","巳","午","未","申","酉","戌","亥");
var Animals=new Array("鼠","牛","虎","兔","龙","蛇","马","羊","猴","鸡","狗","猪");
var solarTerm = new Array("小寒","大寒","立春","雨水","惊蛰","春分","清明","谷雨","立夏","小满","芒种","夏至","小暑","大暑","立秋","处暑","白露","秋分","寒露","霜降","立冬","小雪","大雪","冬至");
var sTerminfo = new Array(0,21208,42467,63836,85337,107014,128867,150921,173149,195551,218072,240693,263343,285989,308563,331033,353350,375494,397447,419210,440795,462224,483532,504758);
var nstr1 = new Array('日','一','二','三','四','五','六','七','八','九','十');
var nstr2 = new Array('初','十','廿','卅','□');
var monthname = new Array("JAn","FEB","MAR","ApR","MAY","Jun","JuL","AuG","sEp","oCT","noV","dEC");
//国历节日 *表示放假日
var sFtv = new Array(
"0101*元旦节",
"0202 世界湿地日",
"0210 国际气象节",
"0214 情人节",
"0301 国际海豹日",
"0303 全国爱耳日",
"0305 学雷锋纪念日",
"0308 妇女节",
"0312 植树节 孙中山逝世纪念日",
"0314 国际警察日",
"0315 消费者权益日",
"0317 中国国医节 国际航海日",
"0321 世界森林日 去掉种族歧视国际日 世界儿歌日",
"0322 世界水日",
"0323 世界气象日",
"0324 世界防治结核病日",
"0325 全国中小学生安全教育日",
"0330 巴勒斯坦国土日",
"0401 愚人节 全国爱国卫生运动月(四月) 税收宣传月(四月)",
"0407 世界卫生日",
"0422 世界地球日",
"0423 世界图书和版权日",
"0424 亚非新闻工作者日",
"0429*劳动节假日",
"0430*劳动节假日",
"0501*劳动节",
"0504 青年节",
"0505 碘缺乏病防治日",
"0508 世界红十字日",
"0512 国际护士节",
"0515 国际家庭日",
"0517 国际电信日",
"0518 国际博物馆日",
"0520 全国学生营养日",
"0523 国际牛奶日",
"0531 世界无烟日",
"0601 国际儿童节",
"0605 世界环境保护日",
"0606 全国爱眼日",
"0617 防治荒漠化和干旱日",
"0623 国际奥林匹克日",
"0625 全国土地日",
"0626 国际禁毒日",
"0701 香港回归纪念日 中共诞辰 世界建筑日",
"0702 国际体育记者日",
"0707 抗日战争纪念日",
"0711 世界人口日",
"0730 非洲妇女日",
"0801 建军节",
"0808 中国男子节(爸爸节)",
"0815 抗日战争胜利纪念",
"0908 国际扫盲日 国际新闻工作者日",
"0909 毛-泽-东逝世纪念",
"0910 中国教师节",
"0914 世界清洁地球日",
"0916 国际臭氧层保护日",
"0918 九·一八事变纪念日",
"0920 国际爱牙日",
"0927 世界旅游日",
"0928 孔子诞辰",
"1001*国庆节 世界音乐日 国际老人节",
"1002*国庆节假日 国际和平与民主自由斗争日",
"1003*国庆节假日",
"1004 世界动物日",
"1006 老人节",
"1008 全国高血压日 世界视觉日",
"1009 世界邮政日 万国邮联日",
"1010 辛亥革命纪念日 世界精神卫生日",
"1013 世界保健日 国际教师节",
"1014 世界标准日",
"1015 国际盲人节(白手杖节)",
"1016 世界粮食日",
"1017 世界去掉贫困日",
"1022 世界传统医药日",
"1024 联合国日",
"1031 世界勤俭日",
"1107 十月社会主义革命纪念日",
"1108 中国记者日",
"1109 全国消防安全宣传教育日",
"1110 世界青年节",
"1111 国际科学与和平周(本日所属的一周)",
"1112 孙中山诞辰纪念日",
"1114 世界糖尿病日",
"1117 国际大学生节 世界学生节",
"1120*彝族年",
"1121*彝族年 世界问候日 世界电视日",
"1122*彝族年",
"1129 国际声援巴勒斯坦人民国际日",
"1201 世界艾滋病日",
"1203 世界残疾人日",
"1205 国际经济和社会发展志愿人员日",
"1208 国际儿童电视日",
"1209 世界足球日",
"1210 世界人权日",
"1212 西安事变纪念日",
"1213 南京大屠杀(1937年)纪念日!紧记血泪史!",
"1220 澳门回归纪念",
"1221 国际篮球日",
"1224 平安夜",
"1225 圣诞节",
"1226 毛-泽-东诞辰纪念")
//农历节日 *表示放假日
var lFtv = new Array(
"0101*春节",
"0102*初二",
"0103*初三",
"0115 元宵节",
"0505 端午节",
"0707 七夕情人节",
"0715 中元节",
"0815 中秋节",
"0909 重阳节",
"1208 腊八节",
"1223 小年",
"0100 除夕")
//某月的第几个星期几
var wFtv = new Array(
"0150 世界麻风日", //一月的最后一个星期日(月倒数第一个星期日)
"0520 国际母亲节",
"0530 全国助残日",
"0630 父亲节",
"0730 被奴役国家周",
"0932 国际和平日",
"0940 国际聋人节 世界儿童日",
"0950 世界海事日",
"1011 国际住房日",
"1013 国际减轻自然灾害日(减灾日)",
"1144 感恩节")
/*****************************************************************************
日期计算
*****************************************************************************/
//====================================== 返回农历 y年的总天数
function lYeardays(y) {
var i, sum = 348;
for(i=0x8000; i>0x8; i>>=1) sum += (lunarinfo[y-1900] & i)? 1: 0;
return(sum+leapdays(y));
}
//====================================== 返回农历 y年闰月的天数
function leapdays(y) {
if(leapMonth(y)) return((lunarinfo[y-1900] & 0x10000)? 30: 29);
else return(0);
}
//====================================== 返回农历 y年闰哪个月 1-12 , 没闰返回 0
function leapMonth(y) {
return(lunarinfo[y-1900] & 0xf);
}
//====================================== 返回农历 y年m月的总天数
function monthdays(y,m) {
return( (lunarinfo[y-1900] & (0x10000>>m))? 30: 29 );
}
//====================================== 算出农历, 传入日期控件, 返回农历日期控件
// 该控件属性有 .year .month .day .isLeap
function Lunar(objdate) {
var i, leap=0, temp=0;
var offset = (date.uTC(objdate.getFullYear(),objdate.getMonth(),objdate.getdate()) - date.uTC(1900,0,31))/86400000;
for(i=1900; i<2050 && offset>0; i++) { temp=lYeardays(i); offset-=temp; }
if(offset<0) { offset+=temp; i--; }
this.year = i;
leap = leapMonth(i); //闰哪个月
this.isLeap = false;
for(i=1; i<13 && offset>0; i++) {
//闰月
if(leap>0 && i==(leap+1) && this.isLeap==false)
{ --i; this.isLeap = true; temp = leapdays(this.year); }
else
{ temp = monthdays(this.year, i); }
//解除闰月
if(this.isLeap==true && i==(leap+1)) this.isLeap = false;
offset -= temp;
}
if(offset==0 && leap>0 && i==leap+1)
if(this.isLeap)
{ this.isLeap = false; }
else
{ this.isLeap = true; --i; }
if(offset<0){ offset += temp; --i; }
this.month = i;
this.day = offset + 1;
}
//==============================返回公历 y年某m+1月的天数
function solardays(y,m) {
if(m==1)
return(((y%4 == 0) && (y%100 != 0) || (y%400 == 0))? 29: 28);
else
return(solarMonth[m]);
}
//============================== 传入 offset 返回干支, 0=甲子
function cyclical(num) {
return(Gan[num%10]+Zhi[num%12]);
}
//============================== 阴历属性
function calElement(sYear,sMonth,sday,week,lYear,lMonth,lday,isLeap,cYear,cMonth,cday) {
this.isToday = false;
//瓣句
this.sYear = sYear; //公元年4位数字
this.sMonth = sMonth; //公元月数字
this.sday = sday; //公元日数字
this.week = week; //星期, 1个免费
//农历
this.lYear = lYear; //公元年4位数字
this.lMonth = lMonth; //农历月数字
this.lday = lday; //农历日数字
this.isLeap = isLeap; //是否为农历闰月?
//八字
this.cYear = cYear; //年柱, 2个免费
this.cMonth = cMonth; //月柱, 2个免费
this.cday = cday; //日柱, 2个免费
this.color = '';
this.lunarFestival = ''; //农历节日
this.solarFestival = ''; //公历节日
this.solarTerms = ''; //节气
}
//===== 某年的第n个节气为几日(从0小寒起算)
function sTerm(y,n) {
var offdate = new date( ( 31556925974.7*(y-1900) + sTerminfo[n]*60000 ) + date.uTC(1900,0,6,2,5) );
return(offdate.getuTCdate());
}
//============================== 返回阴历控件 (y年,m+1月)
/*
功能说明: 返回整个月的日期资料控件
使用方式: oBJ = new calendar(年,零起算月);
oBJ.length 返回当月最大日
oBJ.firstweek 返回当月一日星期
由 oBJ[日期].属性名称 直接取得各项值
oBJ[日期].isToday 返回是否为今日 true 或 false
其他 oBJ[日期] 属性参见 calElement() 中的注解
*/
function calendar(y,m) {
var sdobj, ldobj, lY, lM, ld=1, lL, lx=0, tmp1, tmp2, tmp3;
var cY, cM, cd; //年柱,月柱,日柱
var ldpos = new Array(3);
var n = 0;
var firstLM = 0;
sdobj = new date(y,m,1,0,0,0,0); //当月一日日期
this.length = solardays(y,m); //公历当月天数
this.firstweek = sdobj.getday(); //公历当月1日星期几
////////年柱 1900年立春后为庚子年(60进制36)
if(m<2) cY=cyclical(y-1900+36-1);
else cY=cyclical(y-1900+36);
var term2=sTerm(y,2); //立春日期
////////月柱 1900年1月小寒以前为 丙子月(60进制12)
var firstnode = sTerm(y,m*2) //返回当月「节」为几日开始
cM = cyclical((y-1900)*12+m+12);
//当月一日与 1900/1/1 相差天数
//1900/1/1与 1970/1/1 相差25567日, 1900/1/1 日柱为甲戌日(60进制10)
var dayCyclical = date.uTC(y,m,1,0,0,0,0)/86400000+25567+10;
for(var i=0;i<this.length;i++) {
if(ld>lx) {
sdobj = new date(y,m,i+1); //当月一日日期
ldobj = new Lunar(sdobj); //农历
lY = ldobj.year; //农历年
lM = ldobj.month; //农历月
ld = ldobj.day; //农历日
lL = ldobj.isLeap; //农历是否闰月
lx = lL? leapdays(lY): monthdays(lY,lM); //农历当月最后一天
if(n==0) firstLM = lM;
ldpos[n++] = i-ld+1;
}
//依节气调整二月分的年柱, 以立春为界
if(m==1 && (i+1)==term2) cY=cyclical(y-1900+36);
//依节气月柱, 以「节」为界
if((i+1)==firstnode) cM = cyclical((y-1900)*12+m+13);
//日柱
cd = cyclical(dayCyclical+i);
//sYear,sMonth,sday,week,
//lYear,lMonth,lday,isLeap,
//cYear,cMonth,cday
this[i] = new calElement(y, m+1, i+1, nstr1[(i+this.firstweek)%7],
lY, lM, ld++, lL,
cY ,cM, cd );
}
//节气
tmp1=sTerm(y,m*2 )-1;
tmp2=sTerm(y,m*2+1)-1;
this[tmp1].solarTerms = solarTerm[m*2];
this[tmp2].solarTerms = solarTerm[m*2+1];
if(m==3) this[tmp1].color = 'red'; //清明颜色
//公历节日
for(i in sFtv)
if(sFtv[i].match(/^(d{2})(d{2})([s*])(.+)$/))
if(number(RegExp.$1)==(m+1)) {
this[number(RegExp.$2)-1].solarFestival += RegExp.$4 + ' ';
if(RegExp.$3=='*') this[number(RegExp.$2)-1].color = 'red';
}
//月周节日
for(i in wFtv)
if(wFtv[i].match(/^(d{2})(d)(d)([s*])(.+)$/))
if(number(RegExp.$1)==(m+1)) {
tmp1=number(RegExp.$2);
tmp2=number(RegExp.$3);
if(tmp1<5)
this[((this.firstweek>tmp2)?7:0) + 7*(tmp1-1) + tmp2 - this.firstweek].solarFestival += RegExp.$5 + ' ';
else {
tmp1 -= 5;
tmp3 = (this.firstweek+this.length-1)%7; //当月最后一天星期?
this[this.length - tmp3 - 7*tmp1 + tmp2 - (tmp2>tmp3?7:0) - 1 ].solarFestival += RegExp.$5 + ' ';
}
}
//农历节日
for(i in lFtv)
if(lFtv[i].match(/^(d{2})(.{2})([s*])(.+)$/)) {
tmp1=number(RegExp.$1)-firstLM;
if(tmp1==-11) tmp1=1;
if(tmp1 >=0 && tmp1<n) {
tmp2 = ldpos[tmp1] + number(RegExp.$2) -1;
if( tmp2 >= 0 && tmp2<this.length && this[tmp2].isLeap!=true) {
this[tmp2].lunarFestival += RegExp.$4 + ' ';
if(RegExp.$3=='*') this[tmp2].color = 'red';
}
}
}
//复活节只出现在3或4月
if(m==2 || m==3) {
var estday = new easter(y);
if(m == estday.m)
this[estday.d-1].solarFestival = this[estday.d-1].solarFestival+' 复活节 Easter sunday';
}
if(m==2) this[20].solarFestival = this[20].solarFestival+unescape('%20%u6d35%u8CE2%u751F%u65E5');
//黑色星期五
if((this.firstweek+12)%7==5)
this[12].solarFestival += '黑色星期五';
//今日
if(y==tY && m==tM) this[td-1].isToday = true;
}
//======================================= 返回该年的复活节(春分后第一次满月周后的第一主日)
function easter(y) {
var term2=sTerm(y,5); //取得春分日期
var dayTerm2 = new date(date.uTC(y,2,term2,0,0,0,0)); //取得春分的公历日期控件(春分一定出现在3月)
var ldayTerm2 = new Lunar(dayTerm2); //取得取得春分农历
if(ldayTerm2.day<15) //取得下个月圆的相差天数
var lMlen= 15-ldayTerm2.day;
else
var lMlen= (ldayTerm2.isLeap? leapdays(y): monthdays(y,ldayTerm2.month)) - ldayTerm2.day + 15;
//一天等于 1000*60*60*24 = 86400000 毫秒
var l15 = new date(dayTerm2.getTime() + 86400000*lMlen ); //求出第一次月圆为公历几日
var dayEaster = new date(l15.getTime() + 86400000*( 7-l15.getuTCday() ) ); //求出下个周日
this.m = dayEaster.getuTCMonth();
this.d = dayEaster.getuTCdate();
}
//====================== 免费日期
function cday(d){
var s;
switch (d) {
case 10:
s = '初十'; break;
case 20:
s = '二十'; break;
break;
case 30:
s = '三十'; break;
break;
default :
s = nstr2[Math.floor(d/10)];
s += nstr1[d%10];
}
return(s);
}
///////////////////////////////////////////////////////////////////////////////
var cld;
function drawCld(sY,sM) {
var i,sd,s,size;
cld = new calendar(sY,sM);
if(sY>1874 && sY<1909) ydisplay = '光绪' + (((sY-1874)==1)?'元':sY-1874);
if(sY>1908 && sY<1912) ydisplay = '宣统' + (((sY-1908)==1)?'元':sY-1908);
if(sY>1911) ydisplay = '建国' + (((sY-1949)==1)?'元':sY-1949);
GZ.innerHTML = ydisplay +'年 农历 ' + cyclical(sY-1900+36) + '年 【'+Animals[(sY-4)%12]+'年】';
YMBG.innerHTML = " " + sY + "<BR> " + monthname[sM];
for(i=0;i<42;i++) {
sobj=eval('sd'+ i);
lobj=eval('Ld'+ i);
sobj.classname = '';
sd = i - cld.firstweek;
if(sd>-1 && sd<cld.length) { //日期内
sobj.innerHTML = sd+1;
if(cld[sd].isToday) sobj.classname = 'todyaColor'; //今日颜色
sobj.style.color = cld[sd].color; //法定假日颜色
if(cld[sd].lday==1) //显示农历月
lobj.innerHTML = '<b>'+(cld[sd].isLeap?'闰':'') + cld[sd].lMonth + '月' + (monthdays(cld[sd].lYear,cld[sd].lMonth)==29?'小':'大')+'</b>';
else //显示农历日
lobj.innerHTML = cday(cld[sd].lday);
s=cld[sd].lunarFestival;
if(s.length>0) { //农历节日
if(s.length>6) s = s.substr(0, 4)+'..';
s = s.fontcolor('red');
}
else { //公历节日
s=cld[sd].solarFestival;
if(s.length>0) {
size = (s.charCodeAt(0)>0 && s.charCodeAt(0)<128)?8:4;
if(s.length>size+2) s = s.substr(0, size)+'..';
s=(s=='黑色星期五')?s.fontcolor('black'):s.fontcolor('blue');
}
else { //廿四节气
s=cld[sd].solarTerms;
if(s.length>0) s = s.fontcolor('limegreen');
}
}
if(cld[sd].solarTerms=='清明') s = '清明节'.fontcolor('red');
if(cld[sd].solarTerms=='芒种') s = '芒种节'.fontcolor('red');
if(cld[sd].solarTerms=='夏至') s = '夏至节'.fontcolor('red');
if(cld[sd].solarTerms=='冬至') s = '冬至节'.fontcolor('red');
if(s.length>0) lobj.innerHTML = s;
}
else { //非日期
sobj.innerHTML = '';
lobj.innerHTML = '';
}
}
}
function changeCld() {
var y,m;
y=CLd.sY.selectedindex+1900;
m=CLd.sM.selectedindex;
drawCld(y,m);
}
function pushBtm(K) {
switch (K){
case 'Yu' :
if(CLd.sY.selectedindex>0) CLd.sY.selectedindex--;
break;
case 'Yd' :
if(CLd.sY.selectedindex<150) CLd.sY.selectedindex++;
break;
case 'Mu' :
if(CLd.sM.selectedindex>0) {
CLd.sM.selectedindex--;
}
else {
CLd.sM.selectedindex=11;
if(CLd.sY.selectedindex>0) CLd.sY.selectedindex--;
}
break;
case 'Md' :
if(CLd.sM.selectedindex<11) {
CLd.sM.selectedindex++;
}
else {
CLd.sM.selectedindex=0;
if(CLd.sY.selectedindex<150) CLd.sY.selectedindex++;
}
break;
default :
CLd.sY.selectedindex=tY-1900;
CLd.sM.selectedindex=tM;
}
changeCld();
}
var Today = new date();
var tY = Today.getFullYear();
var tM = Today.getMonth();
var td = Today.getdate();
//////////////////////////////////////////////////////////////////////////////
var width = "130";
var offsetx = 2;
var offsety = 8;
var x = 0;
var y = 0;
var snow = 0;
var sw = 0;
var cnt = 0;
var dstyle;
document.onmousemove = mEvn;
//显示全面日期资料
function movr(v) {
var s,festival;
var sobj=eval('sd'+ v);
var d=sobj.innerHTML-1;
//sYear,sMonth,sday,week,
//lYear,lMonth,lday,isLeap,
//cYear,cMonth,cday
if(sobj.innerHTML!='') {
sobj.style.cursor = 's-resize';
if(cld[d].solarTerms == '' && cld[d].solarFestival == '' && cld[d].lunarFestival == '')
festival = '';
else
festival = '<TABLE widTH=100% BoRdER=0 CELLpAddinG=2 CELLspACinG=0 BGCoLoR="#CCFFCC"><TR><Td>'+
'<FonT CoLoR="#000000" sTYLE="font-size:9pt;">'+cld[d].solarTerms + ' ' + cld[d].solarFestival + ' ' + cld[d].lunarFestival+'</FonT></Td>'+
'</TR></TABLE>';
s= '<TABLE widTH="130" BoRdER=0 CELLpAddinG="2" CELLspACinG=0 BGCoLoR="#000066" style="filter:Alpha(opacity=80)"><TR><Td>' +
'<TABLE widTH=100% BoRdER=0 CELLpAddinG=0 CELLspACinG=0><TR><Td ALiGn="right"><FonT CoLoR="#ffffff" sTYLE="font-size:9pt;">'+
cld[d].sYear+' 年 '+cld[d].sMonth+' 月 '+cld[d].sday+' 日<br>星期'+cld[d].week+'<br>'+
'<font color="violet">农历'+(cld[d].isLeap?'闰 ':' ')+cld[d].lMonth+' 月 '+cld[d].lday+' 日</font><br>'+
'<font color="yellow">'+cld[d].cYear+'年 '+cld[d].cMonth+'月 '+cld[d].cday + '日</font>'+
'</FonT></Td></TR></TABLE>'+ festival +'</Td></TR></TABLE>';
document.all["detail"].innerHTML = s;
if (snow == 0) {
dstyle.left = x+offsetx-(width/2)+"px";
dstyle.top = y+offsety+"px";
dstyle.visibility = "visible";
snow = 1;
}
}
}
//清除全面日期资料
function mout() {
if ( cnt >= 1 ) { sw = 0; }
if ( sw == 0 ) { snow = 0; if(dstyle)dstyle.visibility = "hidden";}
else cnt++;
}
//取得位置
function mEvn(e) {
e= e||window.event;
x=e.clientx;
y=e.clientY;
if (document.body.scrollLeft)
{x=event.x+document.body.scrollLeft; y=event.y+document.body.scrollTop;}
if (snow){
dstyle.left = x+offsetx-(width/2);
dstyle.top = y+offsety;
}
}
///////////////////////////////////////////////////////////////////////////
function changeTZ() {
CiTY.innerHTML = CLd.TZ.value.substr(6)
setCookie("TZ",CLd.TZ.selectedindex)
}
function tick() {
var today
today = new date()
Clock.innerHTML = getCndaystring(today);
Clock2.innerHTML = getEndaystring(TimeAdd(new date(today.touTCstring().slice(0,-4)), CLd.TZ.value))+(blnsummerTime?"<FonT sTYLE='font-size:18pt;font-family:wingdings; color:red'>R</FonT>":"");
setTimeout("tick()", 1000);
}
function setCookie(name, value) {
var today = new date()
var expires = new date()
expires.setTime(today.getTime() + 1000*60*60*24*365)
document.cookie = name + "=" + escape(value) + "; expires=" + expires.toGMTstring()
}
function getCookie(name) {
var search = name + "="
if(document.cookie.length > 0) {
offset = document.cookie.indexof(search)
if(offset != -1) {
offset += search.length
end = document.cookie.indexof(";", offset)
if(end == -1) end = document.cookie.length
return unescape(document.cookie.substring(offset, end))
}
else return ""
}
}
function getCndaystring (dtmday) {
return dtmday.getFullYear()+"年"+(dtmday.getMonth()+1)+"月"+dtmday.getdate()+"日 "+dtmday.getHours()+":"+((dtmday.getMinutes().tostring().length==1)?"0":"")+dtmday.getMinutes()+":"+((dtmday.getseconds().tostring().length==1)?"0":"")+dtmday.getseconds();
}
function getEndaystring (dtmday) {
return dtmday.getFullYear()+"-"+(dtmday.getMonth()+1)+"-"+dtmday.getdate()+" "+dtmday.getHours()+":"+((dtmday.getMinutes().tostring().length==1)?"0":"")+dtmday.getMinutes()+":"+((dtmday.getseconds().tostring().length==1)?"0":"")+dtmday.getseconds();
}
function TimeAdd (uTC,T) {
var plusMinus, y;
if (T.charAt(0)=="-") {
plusMinus = -1;
}
else {
plusMinus = 1
}
//alert(uTC)
//uTC=uTC.slice(4,uTC.length-4);
//alert(uTC)
y=uTC.getFullYear();
uTC.setMinutes(uTC.getMinutes()-(-T.slice(1,3)*60-T.slice(3,5))*plusMinus);
//alert(uTC)
//美国国会于2005年通过扩大日光节约时间法案,将原来开始时间从4月的第一个星期日,提早到3月的第二个星期日;结束时间则从10月的最后一个星期日,延长到11月的第一个星期日。
var dtmdaylightsavingBegin,dtmdaylightsavingEnd;
dtmdaylightsavingBegin = new date(y,3,0);
dtmdaylightsavingBegin.setdate(dtmdaylightsavingBegin.getdate()+(7-dtmdaylightsavingBegin.getday())%7+7);
dtmdaylightsavingEnd = new date(y,10,0);
dtmdaylightsavingEnd.setdate(dtmdaylightsavingEnd.getdate()+(7-dtmdaylightsavingEnd.getday())%7);
if (T.slice(5,6)=="*" && uTC>=dtmdaylightsavingBegin && uTC<=dtmdaylightsavingEnd) {
uTC.setHours(uTC.getHours()+1);
blnsummerTime = true;
}
return uTC;
}
/////////////////////////////////////////////////////////
function initial() {
if (navigator.userAgent.indexof('MsiE')<0) {
document.getElementByid("worldmap").innerHTML="";
}
dstyle = detail.style;
CLd.sY.selectedindex=tY-1900;
CLd.sM.selectedindex=tM;
drawCld(tY,tM);
pushBtm('');
CLd.TZ.selectedindex=getCookie("TZ");
changeTZ();
tick();
}
//-->
</script>
<style>
.todyaColor {
BACKGRound-CoLoR: aqua
}
</style>
<meta content="MsHTML 6.00.2800.1505" name=GEnERAToR>
</head>
<body leftmargin=0 topmargin=0>
<script language=Javascript>
lck=0;
function r(hval)
{
if ( lck == 0 )
{
document.bgColor=hval;
}
}
</script>
<p id=detail style="posiTion: absolute">
</p>
<center>
<br>
<br>
<form name=CLd onsubmit="return false">
<table>
<tbody>
<tr>
<td valign=top align=middle>
<br>
<font style="FonT-siZE: 9pt" size=2>本机时间:</font><br>
<font id=Clock face=Arial color=#000080 size=4 align="center"></font>
<p>
<!--时区 *表示自动调整为日光节约时间-->
<font style="FonT-siZE: 9pt" size=2>
<select style="FonT-siZE: 9pt" onchange=changeTZ() name=TZ>
<option value="-1200 安尼威土克、瓜甲兰" selected>国际换日线
<option value="-1100 中途岛、萨摩亚群岛">萨摩亚
<option value="-1000 夏威夷">夏威夷
<option value=-0900*阿拉斯加>阿拉斯加
<option value=-0800*太平洋时间(美加)、提亚纳>太平洋
<option value=-0700*亚历桑那>美国山区
<option value=-0700*山区时间(美加)>美加山区
<option value=-0600*萨克其万(加拿大)>加拿大中部
<option value=-0600*墨西哥市、塔克西卡帕>墨西哥
<option value=-0600*中部时间(美加)>美加中部
<option value=-0500*波哥大、里玛>南美洲太平洋
<option value=-0500*东部时间(美加)>美加东部
<option value=-0500*印第安纳(东部)>美东
<option value=-0400*加拉卡斯、拉帕兹>南美洲西部
<option value="-0400*大西洋时间 加拿大)">大西洋
<option value="-0330 新岛(加拿大东岸)">纽芬兰
<option value="-0300 波西尼亚">东南美洲
<option value="-0300 布鲁诺斯爱丽斯、乔治城">南美洲东部
<option value=-0200*大西洋中部>大西洋中部
<option value=-0100*亚速尔群岛、维德角群岛>亚速尔
<option value="+0000 格林威治时间、都柏林、爱丁堡、伦敦">英国夏令
<option value="+0000 莫洛维亚(赖比瑞亚)、卡萨布兰卡">格林威治标准
<option value="+0100 巴黎、马德里">罗马
<option value="+0100 布拉格, 华沙, 布达佩斯">中欧
<option value="+0100 柏林、斯德哥尔摩、罗马、伯恩、布鲁赛尔、维也纳">西欧
<option value="+0200 以色列">以色列
<option value=+0200*东欧>东欧
<option value=+0200*开罗>埃及
<option value=+0200*雅典、赫尔辛基、伊斯坦堡>GFT
<option value=+0200*赫拉雷、皮托里>南非
<option value=+0300*巴格达、科威特、奈洛比(肯亚)、里雅德(沙乌地)>沙乌地阿拉伯
<option value=+0300*莫斯科、圣彼得堡、贺占、窝瓦格瑞德>俄罗斯
<option value=+0330*德黑兰>伊朗
<option value=+0400*阿布达比(东阿拉伯)、莫斯凯、塔布理斯(乔治亚共和)>阿拉伯
<option value=+0430*喀布尔>阿富汗
<option value="+0500 伊斯兰马巴德、克洛奇、伊卡特林堡、塔须肯">西亚
<option value="+0530 孟买、加尔各答、马垂斯、新德里、可伦坡">印度
<option value="+0600 阿马提、达卡">中亚
<option value="+0700 曼谷、亚加达、胡志明市">曼谷
<option value="+0800 北京、重庆、黑龙江">中国
<option value="+0800 台湾、香港、新加坡">台北
<option value="+0900 东京、大阪、扎幌、汉城、亚库兹(东西伯利亚)">东京
<option value="+0930 达尔文">澳洲中部
<option value="+1000 布里斯本、墨尔本、席德尼">席德尼
<option value="+1000 霍巴特">塔斯梅尼亚
<option value="+1000 关岛、莫斯比港、海 威">西太平洋
<option value=+1100*马哥大、所罗门群岛、新卡伦多尼亚>太平洋中部
<option value="+1200 威灵顿、奥克兰">纽西兰
<option value="+1200 斐济、肯加塔、马歇尔群岛">斐济</option>
</select>
时间 </font><br>
<font id=Clock2 face=Arial color=#000080 size=4 align="center"></font><br>
<font style="FonT-siZE: 120pt; CoLoR: green; FonT-FAMiLY:webdings" id="worldmap">û</font><br>
<font id=CiTY style="FonT-siZE: 9pt; widTH: 150px; CoLoR: blue; FonT-FAMiLY: '新细明体'"></font>
</p>
</td>
<td align=middle>
<p style="Z-indEx: -1; posiTion: absolute; Top: 40px"><!--背景年月的位置和颜色-->
<font id=YMBG style="FonT-siZE: 90pt; CoLoR: #dddddd; FonT-FAMiLY: 'Arial Black'"> 0000<br>
Jun</font>
</p>
<table border=0>
<tbody>
<tr>
<td bgcolor=#000080 colspan=7>
<font style="FonT-siZE: 9pt" color=#ffffff size=2>公历
<select style="FonT-siZE: 9pt" onchange=changeCld() name=sY>
<script language=Javascript><!--
for(i=1900;i<2050;i++) document.write('<option>'+i)
//--></script>
</select>
年
<select style="FonT-siZE: 9pt" onchange=changeCld() name=sM>
<script language=Javascript><!--
for(i=1;i<13;i++) document.write('<option>'+i)
//--></script>
</select>
月 </font><font id=GZ face=标楷体 color=yellow size=3></font><br>
</td>
</tr>
<tr align=middle bgcolor=#e0e0e0>
<td width=60>
<font color=red>日</font>
</td>
<td width=60>
一
</td>
<td width=60>
二
</td>
<td width=60>
三
</td>
<td width=60>
四
</td>
<td width=60>
五
</td>
<td width=60>
<font color=green>六</font>
</td>
</tr>
<script language=Javascript><!--
var gnum
for(i=0;i<6;i++) {
document.write('<tr align=center>')
for(j=0;j<7;j++) {
gnum = i*7+j
document.write('<td id="Gd' + gnum +'" onm ouseover="movr(' + gnum +')" onm ouseout="mout()"><font id="sd' + gnum +'" size=5 face="Arial Black"')
if(j == 0) document.write(' color=red')
if(j == 6)
if(i%2==1) document.write(' color=red')
else document.write(' color=green')
document.write(' TiTLE=""> </font><br><font id="Ld' + gnum + '" size=2 style="font-size:9pt"> </font></td>')
}
document.write('</tr>')
}
//--></script>
</tbody>
</table>
</td>
<td valign=top align=middle width=40>
<br>
<br>
<br>
<br>
<button style="FonT-siZE: 9pt" onclick="pushBtm('Yu')">年↑</button><br>
<button style="FonT-siZE: 9pt" onclick="pushBtm('Yd')">年↓</button>
<p>
<button style="FonT-siZE: 9pt" onclick="pushBtm('Mu')">月↑</button><br>
<button style="FonT-siZE: 9pt" onclick="pushBtm('Md')">月↓</button>
<p>
<button style="FonT-siZE: 9pt" onclick="pushBtm('')">今日</button>
</p>
</td>
</tr>
</tbody>
</table>
</form>
<p>
</p>
<hr width="90%" color=#cccccc noshade size=1>
<font style="FonT-siZE: 9pt" face=ARiAL size=2>阳历中<font color=red>红色</font>/<font color=green>官方</font><font color=black>表示节假日,农历中<font color=green>官方</font>表示为24节气日,<font color=red>红色</font>表示为传统节日,<font color=blue>蓝色</font>则表示为公众节假日<br>
<script type="text/javascript">
<!--
initial()
//-->
</script>
</center>
<br>
<table align="center" border="0" cellpadding="3" cellspacing="0" width="700">
<tr>
<td align="center">
<b><font color="#008000"></font></b>
</td>
</tr>
</table>
</body>
</html>
把上述代码保存到记事本,修改扩展名为html,双击打开就可以看到效果.
当然,现在的ip138网站也有万年历了,多了假期,不过都是大同小异,万年历网址:http://www.xiazaima.com/
<!doCTYpE html puBLiC "-//w3C//dTd xHTML 1.0 strict//En" "http://www.w3.org/TR/xhtml1/dTd/xhtml1-strict.dtd">
<!-- saved from url=(0014)about:internet -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>万年历查询 日历查询 农历查询 农历日历 老黄历 万年历表</title>
<meta content="农历; 阳历; 月历; 节日; 时区; 节气; 八字; 干支; 生肖; gregorian solar; chinese lunar; calendar;" name="keywords">
<meta content="All" name="robots">
<meta content="gregorian solar calendar and chinese lunar calendar" name="description">
<meta http-equiv="x-ua-compatible" content="ie=7"/>
<style type="text/css"> p {fonT-FAMiLY: 宋体; FonT-siZE: 9pt;line-height:12pt:color:#000000} Td {fonT-FAMiLY: 宋体,simsun; FonT-siZE: 9pt} a:link{ color:#000000; text-decoration:none} a:visited{CoLoR: #000000; TExT-dECoRATion: none} a:active{color:green;text-decoration:none} a:hover{color:red;text-decoration:underline} button{width:39px;height:21px;padding:2px;} .workn{color:red;} .rest{color:green;} .sd{font-family:"Arial Black";font-size:24px;} .panel {border-bottom:1px solid #e5e5e5;border-collapse:collapse;margin-top:10px;} .panel th{border:1px solid #e5e5e5;background-color:#f8f8f8;font-weight:normal;font-size:9pt;padding:3px 1px;} .panel td{border:1px solid #e5e5e5;padding:3px 2px;word-break:break-all;text-align:center;}
</style>
<script language="Javascript">
<!--
var blnsummerTime = false; /***************************************************************************** 日期资料 *****************************************************************************/
var lunarinfo=new Array( 0x04bd8,0x04ae0,0x0a570,0x054d5,0x0d260,0x0d950,0x16554,0x056a0,0x09ad0,0x055d2, 0x04ae0,0x0a5b6,0x0a4d0,0x0d250,0x1d255,0x0b540,0x0d6a0,0x0ada2,0x095b0,0x14977, 0x04970,0x0a4b0,0x0b4b5,0x06a50,0x06d40,0x1ab54,0x02b60,0x09570,0x052f2,0x04970, 0x06566,0x0d4a0,0x0ea50,0x06e95,0x05ad0,0x02b60,0x186e3,0x092e0,0x1c8d7,0x0c950, 0x0d4a0,0x1d8a6,0x0b550,0x056a0,0x1a5b4,0x025d0,0x092d0,0x0d2b2,0x0a950,0x0b557, 0x06ca0,0x0b550,0x15355,0x04da0,0x0a5b0,0x14573,0x052b0,0x0a9a8,0x0e950,0x06aa0, 0x0aea6,0x0ab50,0x04b60,0x0aae4,0x0a570,0x05260,0x0f263,0x0d950,0x05b57,0x056a0, 0x096d0,0x04dd5,0x04ad0,0x0a4d0,0x0d4d4,0x0d250,0x0d558,0x0b540,0x0b6a0,0x195a6, 0x095b0,0x049b0,0x0a974,0x0a4b0,0x0b27a,0x06a50,0x06d40,0x0af46,0x0ab60,0x09570, 0x04af5,0x04970,0x064b0,0x074a3,0x0ea50,0x06b58,0x055c0,0x0ab60,0x096d5,0x092e0, 0x0c960,0x0d954,0x0d4a0,0x0da50,0x07552,0x056a0,0x0abb7,0x025d0,0x092d0,0x0cab5, 0x0a950,0x0b4a0,0x0baa4,0x0ad50,0x055d9,0x04ba0,0x0a5b0,0x15176,0x052b0,0x0a930, 0x07954,0x06aa0,0x0ad50,0x05b52,0x04b60,0x0a6e6,0x0a4e0,0x0d260,0x0ea65,0x0d530, 0x05aa0,0x076a3,0x096d0,0x04bd7,0x04ad0,0x0a4d0,0x1d0b6,0x0d250,0x0d520,0x0dd45, 0x0b5a0,0x056d0,0x055b2,0x049b0,0x0a577,0x0a4b0,0x0aa50,0x1b255,0x06d20,0x0ada0, 0x14b63); var solarMonth=new Array(31,28,31,30,31,30,31,31,30,31,30,31); var Gan=new Array("甲","乙","丙","丁","戊","己","庚","辛","壬","癸"); var Zhi=new Array("子","丑","寅","卯","辰","巳","午","未","申","酉","戌","亥"); var Animals=new Array("鼠","牛","虎","兔","龙","蛇","马","羊","猴","鸡","狗","猪"); var solarTerm = new Array("小寒","大寒","立春","雨水","惊蛰","春分","清明","谷雨","立夏","小满","芒种","夏至","小暑","大暑","立秋","处暑","白露","秋分","寒露","霜降","立冬","小雪","大雪","冬至"); var sTerminfo = new Array(0,21208,42467,63836,85337,107014,128867,150921,173149,195551,218072,240693,263343,285989,308563,331033,353350,375494,397447,419210,440795,462224,483532,504758); var nstr1 = new Array('日','一','二','三','四','五','六','七','八','九','十'); var nstr2 = new Array('初','十','廿','卅','□'); var monthname = new Array("JAn","FEB","MAR","ApR","MAY","Jun","JuL","AuG","sEp","oCT","noV","dEC"); //国历节日 *表示放假日
var sFtv = new Array( "0101*元旦节", "0202 世界湿地日", "0210 国际气象节", "0214 情人节", "0301 国际海豹日", "0303 全国爱耳日", "0305 学雷锋纪念日", "0308 妇女节", "0312 植树节 孙中山逝世纪念日", "0314 国际警察日", "0315 消费者权益日", "0317 中国国医节 国际航海日", "0321 世界森林日 去掉种族歧视国际日 世界儿歌日", "0322 世界水日", "0323 世界气象日", "0324 世界防治结核病日", "0325 全国中小学生安全教育日", "0330 巴勒斯坦国土日", "0401 愚人节 全国爱国卫生运动月(四月) 税收宣传月(四月)", "0407 世界卫生日", "0422 世界地球日", "0423 世界图书和版权日", "0424 亚非新闻工作者日", "0429*劳动节假日", "0430*劳动节假日", "0501*劳动节", "0504 青年节", "0505 碘缺乏病防治日", "0508 世界红十字日", "0512 国际护士节", "0515 国际家庭日", "0517 世界电信日", "0518 国际博物馆日", "0520 全国学生营养日", "0522 国际生物多样性日", "0523 国际牛奶日", "0531 世界无烟日", "0601 国际儿童节", "0605 世界环境日", "0606 全国爱眼日", "0617 防治荒漠化和干旱日", "0623 国际奥林匹克日", "0625 全国土地日", "0626 国际禁毒日", "0701 香港回归纪念日 中共诞辰 世界建筑日", "0702 国际体育记者日", "0707 抗日战争纪念日", "0711 世界人口日", "0730 非洲妇女日", "0801 建军节", "0808 中国男子节(爸爸节)", "0815 抗日战争胜利纪念", "0908 国际扫盲日 国际新闻工作者日", "0909 毛-泽-东逝世纪念", "0910 中国教师节", "0914 世界清洁地球日", "0916 国际臭氧层保护日", "0918 九·一八事变纪念日", "0920 国际爱牙日", "0927 世界旅游日", "0928 孔子诞辰", "1001*国庆节 世界音乐日 国际老人节", "1002*国庆节假日 国际和平与民主自由斗争日", "1003*国庆节假日", "1004 世界动物日", "1006 老人节", "1008 全国高血压日 世界视觉日", "1009 世界邮政日 万国邮联日", "1010 辛亥革命纪念日 世界精神卫生日", "1013 世界保健日 国际教师节", "1014 世界标准日", "1015 国际盲人节(白手杖节)", "1016 世界粮食日", "1017 世界去掉贫困日", "1022 世界传统医药日", "1024 联合国日 世界发展信息日", "1031 世界勤俭日", "1107 十月社会主义革命纪念日", "1108 中国记者日", "1109 全国消防安全宣传教育日", "1110 世界青年节", "1111 国际科学与和平周(本日所属的一周)", "1112 孙中山诞辰纪念日", "1114 世界糖尿病日", "1117 国际大学生节 世界学生节", "1120*彝族年", "1121*彝族年 世界问候日 世界电视日", "1122*彝族年", "1129 国际声援巴勒斯坦人民国际日", "1201 世界艾滋病日", "1203 世界残疾人日", "1205 国际经济和社会发展志愿人员日", "1208 国际儿童电视日", "1209 世界足球日", "1210 世界人权日", "1212 西安事变纪念日", "1213 南京大屠杀(1937年)纪念日!紧记血泪史!", "1220 澳门回归纪念", "1221 国际篮球日", "1224 平安夜", "1225 圣诞节", "1226 毛-泽-东诞辰纪念") //农历节日 *表示放假日
var lFtv = new Array( "0101*春节", "0102*初二", "0103*初三", "0115 元宵节", "0202 龙抬头节", "0323 妈祖生辰", "0505 端午节", "0707 七夕情人节", "0715 中元节", "0815 中秋节", "0909 重阳节", "1208 腊八节", "1223 小年", "0100 除夕") //某月的第几个星期几
var wFtv = new Array( "0110 黑人日", "0150 世界麻风日", //一月的最后一个星期日(月倒数第一个星期日)
"0520 国际母亲节", "0530 全国助残日", "0630 父亲节", "0730 被奴役国家周", "0932 国际和平日", "0940 国际聋人节 世界儿童日", "0950 世界海事日", "1011 国际住房日", "1013 国际减轻自然灾害日(减灾日)", "1144 感恩节") //放假
var worktime = {}; worktime.y2011 = Json.parse('{"d0402":{"w":"上班"},"d0403":{"w":"放假"},"d0404":{"w":"放假"},"d0405":{"w":"放假"},"d0430":{"w":"放假"},"d0501":{"w":"放假"},"d0502":{"w":"放假"},"d0604":{"w":"放假"},"d0605":{"w":"放假"},"d0606":{"w":"放假"},"d0910":{"w":"放假"},"d0911":{"w":"放假"},"d0912":{"w":"放假"},"d1001":{"w":"放假"},"d1002":{"w":"放假"},"d1003":{"w":"放假"},"d1004":{"w":"放假"},"d1005":{"w":"放假"},"d1006":{"w":"放假"},"d1007":{"w":"放假"},"d1008":{"w":"上班"},"d1009":{"w":"上班"},"d1231":{"w":"上班"}}'); worktime.y2012 = Json.parse('{"d0101":{"w":"放假"},"d0102":{"w":"放假"},"d0103":{"w":"放假"},"d0121":{"w":"上班"},"d0122":{"w":"放假"},"d0123":{"w":"放假"},"d0124":{"w":"放假"},"d0125":{"w":"放假"},"d0126":{"w":"放假"},"d0127":{"w":"放假"},"d0128":{"w":"放假"},"d0129":{"w":"上班"},"d0331":{"w":"上班"},"d0401":{"w":"上班"},"d0402":{"w":"放假"},"d0403":{"w":"放假"},"d0404":{"w":"放假"},"d0428":{"w":"上班"},"d0429":{"w":"放假"},"d0430":{"w":"放假"},"d0501":{"w":"放假"},"d0622":{"w":"放假"},"d0623":{"w":"放假"},"d0624":{"w":"放假"},"d0929":{"w":"上班"},"d0930":{"w":"放假"},"d1001":{"w":"放假"},"d1002":{"w":"放假"},"d1003":{"w":"放假"},"d1004":{"w":"放假"},"d1005":{"w":"放假"},"d1006":{"w":"放假"},"d1007":{"w":"放假"}}'); worktime.y2013 = Json.parse('{"d0101":{"w":"放假"},"d0102":{"w":"放假"},"d0103":{"w":"放假"},"d0105":{"w":"上班"},"d0106":{"w":"上班"},"d0209":{"w":"放假"},"d0210":{"w":"放假"},"d0211":{"w":"放假"},"d0212":{"w":"放假"},"d0213":{"w":"放假"},"d0214":{"w":"放假"},"d0215":{"w":"放假"},"d0216":{"w":"上班"},"d0217":{"w":"上班"},"d0404":{"w":"放假"},"d0405":{"w":"放假"},"d0406":{"w":"放假"},"d0407":{"w":"上班"},"d0427":{"w":"上班"},"d0428":{"w":"上班"},"d0429":{"w":"放假"},"d0430":{"w":"放假"},"d0501":{"w":"放假"},"d0608":{"w":"上班"},"d0609":{"w":"上班"},"d0610":{"w":"放假"},"d0611":{"w":"放假"},"d0612":{"w":"放假"},"d0919":{"w":"放假"},"d0920":{"w":"放假"},"d0921":{"w":"放假"},"d0922":{"w":"上班"},"d0929":{"w":"上班"},"d1001":{"w":"放假"},"d1002":{"w":"放假"},"d1003":{"w":"放假"},"d1004":{"w":"放假"},"d1005":{"w":"放假"},"d1006":{"w":"放假"},"d1007":{"w":"放假"},"d1012":{"w":"上班"}}'); worktime.y2014 = Json.parse('{"d0101":{"w":"放假"},"d0126":{"w":"上班"},"d0131":{"w":"放假"},"d0201":{"w":"放假"},"d0202":{"w":"放假"},"d0203":{"w":"放假"},"d0204":{"w":"放假"},"d0205":{"w":"放假"},"d0206":{"w":"放假"},"d0208":{"w":"上班"},"d0405":{"w":"放假"},"d0407":{"w":"放假"},"d0501":{"w":"放假"},"d0502":{"w":"放假"},"d0503":{"w":"放假"},"d0504":{"w":"上班"},"d0602":{"w":"放假"},"d0908":{"w":"放假"},"d0928":{"w":"上班"},"d1001":{"w":"放假"},"d1002":{"w":"放假"},"d1003":{"w":"放假"},"d1004":{"w":"放假"},"d1005":{"w":"放假"},"d1006":{"w":"放假"},"d1007":{"w":"放假"},"d1011":{"w":"上班"}}'); worktime.y2015 = Json.parse('{"d0101":{"w":"放假"},"d0102":{"w":"放假"},"d0103":{"w":"放假"},"d0104":{"w":"上班"},"d0215":{"w":"上班"},"d0218":{"w":"放假"},"d0219":{"w":"放假"},"d0220":{"w":"放假"},"d0221":{"w":"放假"},"d0222":{"w":"放假"},"d0223":{"w":"放假"},"d0224":{"w":"放假"},"d0228":{"w":"上班"},"d0405":{"w":"放假"},"d0406":{"w":"补休"},"d0501":{"w":"放假"},"d0620":{"w":"放假"},"d0622":{"w":"补休"},"d0903":{"w":"放假"},"d0904":{"w":"调休"},"d0906":{"w":"上班"},"d0927":{"w":"放假"},"d1001":{"w":"放假"},"d1002":{"w":"放假"},"d1003":{"w":"放假"},"d1004":{"w":"放假"},"d1005":{"w":"放假"},"d1006":{"w":"放假"},"d1007":{"w":"放假"},"d1010":{"w":"上班"}}'); worktime.y2016 = Json.parse('{"d0101":{"w":"放假"},"d0102":{"w":"放假"},"d0103":{"w":"放假"},"d0206":{"w":"上班"},"d0207":{"w":"放假"},"d0208":{"w":"放假"},"d0209":{"w":"放假"},"d0210":{"w":"放假"},"d0211":{"w":"放假"},"d0212":{"w":"放假"},"d0213":{"w":"放假"},"d0214":{"w":"上班"},"d0402":{"w":"放假"},"d0403":{"w":"放假"},"d0404":{"w":"放假"},"d0430":{"w":"放假"},"d0501":{"w":"放假"},"d0502":{"w":"补休"},"d0609":{"w":"放假"},"d0610":{"w":"放假"},"d0611":{"w":"放假"},"d0612":{"w":"上班"},"d0915":{"w":"放假"},"d0916":{"w":"放假"},"d0917":{"w":"放假"},"d0918":{"w":"上班"},"d1001":{"w":"放假"},"d1002":{"w":"放假"},"d1003":{"w":"放假"},"d1004":{"w":"放假"},"d1005":{"w":"放假"},"d1006":{"w":"放假"},"d1007":{"w":"放假"},"d1008":{"w":"上班"},"d1009":{"w":"上班"}}'); /***************************************************************************** 日期计算 *****************************************************************************/
//====================================== 返回农历 y年的总天数
function lYeardays(y) { var i, sum = 348; for(i=0x8000; i>0x8; i>>=1) sum += (lunarinfo[y-1900] & i)? 1: 0; return(sum+leapdays(y)); } //====================================== 返回农历 y年闰月的天数
function leapdays(y) { if(leapMonth(y)) return((lunarinfo[y-1900] & 0x10000)? 30: 29); else return(0); } //====================================== 返回农历 y年闰哪个月 1-12 , 没闰返回 0
function leapMonth(y) { return(lunarinfo[y-1900] & 0xf); } //====================================== 返回农历 y年m月的总天数
function monthdays(y,m) { return( (lunarinfo[y-1900] & (0x10000>>m))? 30: 29 ); } //====================================== 算出农历, 传入日期控件, 返回农历日期控件 // 该控件属性有 .year .month .day .isLeap
function Lunar(objdate) { var i, leap=0, temp=0; var offset = (date.uTC(objdate.getFullYear(),objdate.getMonth(),objdate.getdate()) - date.uTC(1900,0,31))/86400000;
for(i=1900; i<2050 && offset>0; i++) { temp=lYeardays(i); offset-=temp; } if(offset<0) { offset+=temp; i--; } this.year = i; leap = leapMonth(i); //闰哪个月
this.isLeap = false; for(i=1; i<13 && offset>0; i++) { //闰月
if(leap>0 && i==(leap+1) && this.isLeap==false) { --i; this.isLeap = true; temp = leapdays(this.year); } else { temp = monthdays(this.year, i); } //解除闰月
if(this.isLeap==true && i==(leap+1)) this.isLeap = false; offset -= temp; } if(offset==0 && leap>0 && i==leap+1) if(this.isLeap) { this.isLeap = false; } else { this.isLeap = true; --i; } if(offset<0){ offset += temp; --i; } this.month = i; this.day = offset + 1; } //==============================返回公历 y年某m+1月的天数
function solardays(y,m) { if(m==1) return(((y%4 == 0) && (y%100 != 0) || (y%400 == 0))? 29: 28); else
return(solarMonth[m]); } //============================== 传入 offset 返回干支, 0=甲子
function cyclical(num) { return(Gan[num%10]+Zhi[num%12]); } //============================== 阴历属性
function calElement(sYear,sMonth,sday,week,lYear,lMonth,lday,isLeap,cYear,cMonth,cday) { this.isToday = false; //瓣句
this.sYear = sYear; //公元年4位数字
this.sMonth = sMonth; //公元月数字
this.sday = sday; //公元日数字
this.week = week; //星期, 1个免费 //农历
this.lYear = lYear; //公元年4位数字
this.lMonth = lMonth; //农历月数字
this.lday = lday; //农历日数字
this.isLeap = isLeap; //是否为农历闰月? //八字
this.cYear = cYear; //年柱, 2个免费
this.cMonth = cMonth; //月柱, 2个免费
this.cday = cday; //日柱, 2个免费
this.color = ''; this.lunarFestival = ''; //农历节日
this.solarFestival = ''; //公历节日
this.solarTerms = ''; //节气
} //===== 某年的第n个节气为几日(从0小寒起算)
function sTerm(y,n) { var offdate = new date( ( 31556925974.7*(y-1900) + sTerminfo[n]*60000 ) + date.uTC(1900,0,6,2,5) ); return(offdate.getuTCdate()); } //============================== 返回阴历控件 (y年,m+1月) /* 功能说明: 返回整个月的日期资料控件 使用方式: oBJ = new calendar(年,零起算月); oBJ.length 返回当月最大日 oBJ.firstweek 返回当月一日星期 由 oBJ[日期].属性名称 直接取得各项值 oBJ[日期].isToday 返回是否为今日 true 或 false 其他 oBJ[日期] 属性参见 calElement() 中的注解 */
function calendar(y,m) { var sdobj, ldobj, lY, lM, ld=1, lL, lx=0, tmp1, tmp2, tmp3; var cY, cM, cd; //年柱,月柱,日柱
var ldpos = new Array(3); var n = 0; var firstLM = 0; sdobj = new date(y,m,1,0,0,0,0); //当月一日日期
this.length = solardays(y,m); //公历当月天数
this.firstweek = sdobj.getday(); //公历当月1日星期几 ////////年柱 1900年立春后为庚子年(60进制36)
if(m<2) cY=cyclical(y-1900+36-1); else cY=cyclical(y-1900+36); var term2=sTerm(y,2); //立春日期 ////////月柱 1900年1月小寒以前为 丙子月(60进制12)
var firstnode = sTerm(y,m*2) //返回当月「节」为几日开始
cM = cyclical((y-1900)*12+m+12); //当月一日与 1900/1/1 相差天数 //1900/1/1与 1970/1/1 相差25567日, 1900/1/1 日柱为甲戌日(60进制10)
var dayCyclical = date.uTC(y,m,1,0,0,0,0)/86400000+25567+10;
for(var i=0;i<this.length;i++) { if(ld>lx) { sdobj = new date(y,m,i+1); //当月一日日期
ldobj = new Lunar(sdobj); //农历
lY = ldobj.year; //农历年
lM = ldobj.month; //农历月
ld = ldobj.day; //农历日
lL = ldobj.isLeap; //农历是否闰月
lx = lL? leapdays(lY): monthdays(lY,lM); //农历当月最后一天
if(n==0) firstLM = lM; ldpos[n++] = i-ld+1; } //依节气调整二月分的年柱, 以立春为界
if(m==1 && (i+1)==term2) cY=cyclical(y-1900+36); //依节气月柱, 以「节」为界
if((i+1)==firstnode) cM = cyclical((y-1900)*12+m+13); //日柱
cd = cyclical(dayCyclical+i); //sYear,sMonth,sday,week, //lYear,lMonth,lday,isLeap, //cYear,cMonth,cday
this[i] = new calElement(y, m+1, i+1, nstr1[(i+this.firstweek)%7], lY, lM, ld++, lL, cY ,cM, cd ); } //节气
tmp1=sTerm(y,m*2 )-1; tmp2=sTerm(y,m*2+1)-1; this[tmp1].solarTerms = solarTerm[m*2]; this[tmp2].solarTerms = solarTerm[m*2+1]; if(m==3) this[tmp1].color = 'red'; //清明颜色 //公历节日
for(i in sFtv) if(sFtv[i].match(/^(d{2})(d{2})([s*])(.+)$/)) if(number(RegExp.$1)==(m+1)) { this[number(RegExp.$2)-1].solarFestival += RegExp.$4 + ' '; if(RegExp.$3=='*') this[number(RegExp.$2)-1].color = 'red'; } //月周节日
for(i in wFtv) if(wFtv[i].match(/^(d{2})(d)(d)([s*])(.+)$/)) if(number(RegExp.$1)==(m+1)) { tmp1=number(RegExp.$2); tmp2=number(RegExp.$3); if(tmp1<5) this[((this.firstweek>tmp2)?7:0) + 7*(tmp1-1) + tmp2 - this.firstweek].solarFestival += RegExp.$5 + ' '; else { tmp1 -= 5; tmp3 = (this.firstweek+this.length-1)%7; //当月最后一天星期?
this[this.length - tmp3 - 7*tmp1 + tmp2 - (tmp2>tmp3?7:0) - 1 ].solarFestival += RegExp.$5 + ' '; } } //农历节日
for(i in lFtv) if(lFtv[i].match(/^(d{2})(.{2})([s*])(.+)$/)) { tmp1=number(RegExp.$1)-firstLM; if(tmp1==-11) tmp1=1; if(tmp1 >=0 && tmp1<n) { tmp2 = ldpos[tmp1] + number(RegExp.$2) -1; if( tmp2 >= 0 && tmp2<this.length && this[tmp2].isLeap!=true) { this[tmp2].lunarFestival += RegExp.$4 + ' '; if(RegExp.$3=='*') this[tmp2].color = 'red'; } } } //复活节只出现在3或4月
if(m==2 || m==3) { var estday = new easter(y); if(m == estday.m) this[estday.d-1].solarFestival = this[estday.d-1].solarFestival+' 复活节 Easter sunday'; } if(m==2) this[20].solarFestival = this[20].solarFestival+unescape('%20%u6d35%u8CE2%u751F%u65E5'); //黑色星期五
if((this.firstweek+12)%7==5) this[12].solarFestival += '黑色星期五'; //今日
if(y==tY && m==tM) this[td-1].isToday = true; } //======================================= 返回该年的复活节(春分后第一次满月周后的第一主日)
function easter(y) { var term2=sTerm(y,5); //取得春分日期
var dayTerm2 = new date(date.uTC(y,2,term2,0,0,0,0)); //取得春分的公历日期控件(春分一定出现在3月)
var ldayTerm2 = new Lunar(dayTerm2); //取得取得春分农历
if(ldayTerm2.day<15) //取得下个月圆的相差天数
var lMlen= 15-ldayTerm2.day; else
var lMlen= (ldayTerm2.isLeap? leapdays(y): monthdays(y,ldayTerm2.month)) - ldayTerm2.day + 15; //一天等于 1000*60*60*24 = 86400000 毫秒
var l15 = new date(dayTerm2.getTime() + 86400000*lMlen ); //求出第一次月圆为公历几日
var dayEaster = new date(l15.getTime() + 86400000*( 7-l15.getuTCday() ) ); //求出下个周日
this.m = dayEaster.getuTCMonth(); this.d = dayEaster.getuTCdate(); } //====================== 免费日期
function cday(d){ var s; switch (d) { case 10: s = '初十'; break; case 20: s = '二十'; break; break; case 30: s = '三十'; break; break; default : s = nstr2[Math.floor(d/10)];
s += nstr1[d%10]; } return(s); } ///////////////////////////////////////////////////////////////////////////////
var cld; function drawCld(sY,sM) { var i,sd,s,size; cld = new calendar(sY,sM); if(sY>1874 && sY<1909) ydisplay = '光绪' + (((sY-1874)==1)?'元':sY-1874); if(sY>1908 && sY<1912) ydisplay = '宣统' + (((sY-1908)==1)?'元':sY-1908); if(sY>1911) ydisplay = '建国' + (((sY-1949)==1)?'元':sY-1949); GZ.innerHTML = ydisplay +'年 农历 ' + cyclical(sY-1900+36) + '年 【'+Animals[(sY-4)%12]+'年】'; YMBG.innerHTML = " " + sY + "<BR> " + monthname[sM]; for(i=0;i<42;i++) { sobj=eval('sd'+ i); lobj=eval('Ld'+ i); wobj=eval('wT'+ i); gdobj=eval('Gd'+ i); gdobj.style.backgroundColor="" sobj.classname = 'sd'; sd = i - cld.firstweek; if(sd>-1 && sd<cld.length) { //日期内
sobj.innerHTML = sd+1; var s_m = sM+1,s_d =sd+1, h_t = (s_m < 10? ('0' + s_m): s_m)+''+ (s_d < 10 ? ('0' + s_d) : s_d); var workT; var work_T = worktime["y"+sY]; if(work_T!=undefined){ workT = work_T["d"+h_t]; if(workT!=undefined){ var classn = ""; if(workT.w=="上班"){ classn = "workn"; gdobj.style.backgroundColor="#ffcccc" } else{ classn = "rest"; gdobj.style.backgroundColor="#99ffcc" } wobj.innerHTML="<p class=""+classn+"">" + workT.w + "</p>"; } else{ wobj.innerHTML="<br>"; } } else{ wobj.innerHTML="<br>"; } if(cld[sd].isToday) sobj.classname = 'sd todyaColor'; //今日颜色
sobj.style.color = cld[sd].color; //法定假日颜色
if(cld[sd].lday==1) //显示农历月
lobj.innerHTML = '<b>'+(cld[sd].isLeap?'闰':'') + cld[sd].lMonth + '月' + (monthdays(cld[sd].lYear,cld[sd].lMonth)==29?'小':'大')+'</b>'; else //显示农历日
lobj.innerHTML = cday(cld[sd].lday); s=cld[sd].lunarFestival; if(s.length>0) { //农历节日
if(s.length>6) s = s.substr(0, 4)+'..'; s = s.fontcolor('red'); } else { //公历节日
s=cld[sd].solarFestival; if(s.length>0) { size = (s.charCodeAt(0)>0 && s.charCodeAt(0)<128)?8:4; if(s.length>size+2) s = s.substr(0, size)+'..'; s=(s=='黑色星期五')?s.fontcolor('black'):s.fontcolor('blue'); } else { //廿四节气
s=cld[sd].solarTerms; if(s.length>0) s = s.fontcolor('limegreen'); } } if(cld[sd].solarTerms=='清明') s = '清明节'.fontcolor('red'); if(cld[sd].solarTerms=='芒种') s = '芒种节'.fontcolor('red'); if(cld[sd].solarTerms=='夏至') s = '夏至节'.fontcolor('red'); if(cld[sd].solarTerms=='冬至') s = '冬至节'.fontcolor('red'); if(s.length>0) lobj.innerHTML = s; } else { //非日期
sobj.innerHTML = ''; lobj.innerHTML = ''; wobj.innerHTML = ''; } } } function changeCld() { var y,m; y=CLd.sY.selectedindex+1900; m=CLd.sM.selectedindex; drawCld(y,m); } function pushBtm(K) { switch (K){ case 'Yu' : if(CLd.sY.selectedindex>0) CLd.sY.selectedindex--; break; case 'Yd' : if(CLd.sY.selectedindex<150) CLd.sY.selectedindex++; break; case 'Mu' : if(CLd.sM.selectedindex>0) { CLd.sM.selectedindex--; } else { CLd.sM.selectedindex=11; if(CLd.sY.selectedindex>0) CLd.sY.selectedindex--; } break; case 'Md' : if(CLd.sM.selectedindex<11) { CLd.sM.selectedindex++; } else { CLd.sM.selectedindex=0; if(CLd.sY.selectedindex<150) CLd.sY.selectedindex++; } break; default : CLd.sY.selectedindex=tY-1900; CLd.sM.selectedindex=tM; } changeCld(); } var Today = new date(); var tY = Today.getFullYear(); var tM = Today.getMonth(); var td = Today.getdate(); //////////////////////////////////////////////////////////////////////////////
var width = "130"; var offsetx = 2; var offsety = 8; var x = 0; var y = 0; var snow = 0; var sw = 0; var cnt = 0; var dstyle; document.onmousemove = mEvn; //显示全面日期资料
function movr(v) { var s,festival; var sobj=eval('sd'+ v); var d=sobj.innerHTML-1; //sYear,sMonth,sday,week, //lYear,lMonth,lday,isLeap, //cYear,cMonth,cday
if(sobj.innerHTML!='') { sobj.style.cursor = 's-resize'; if(cld[d].solarTerms == '' && cld[d].solarFestival == '' && cld[d].lunarFestival == '') festival = ''; else festival = '<TABLE widTH=100% BoRdER=0 CELLpAddinG=2 CELLspACinG=0 BGCoLoR="#CCFFCC"><TR><Td>'+
'<FonT CoLoR="#000000" sTYLE="font-size:9pt;">'+cld[d].solarTerms + ' ' + cld[d].solarFestival + ' ' + cld[d].lunarFestival+'</FonT></Td>'+
'</TR></TABLE>'; s= '<TABLE widTH="130" BoRdER=0 CELLpAddinG="2" CELLspACinG=0 BGCoLoR="#000066" style="filter:Alpha(opacity=80)"><TR><Td>' +
'<TABLE widTH=100% BoRdER=0 CELLpAddinG=0 CELLspACinG=0><TR><Td ALiGn="right"><FonT CoLoR="#ffffff" sTYLE="font-size:9pt;">'+ cld[d].sYear+' 年 '+cld[d].sMonth+' 月 '+cld[d].sday+' 日<br>星期'+cld[d].week+'<br>'+
'<font color="violet">农历'+(cld[d].isLeap?'闰 ':' ')+cld[d].lMonth+' 月 '+cld[d].lday+' 日</font><br>'+
'<font color="yellow">'+cld[d].cYear+'年 '+cld[d].cMonth+'月 '+cld[d].cday + '日</font>'+
'</FonT></Td></TR></TABLE>'+ festival +'</Td></TR></TABLE>'; document.all["detail"].innerHTML = s; if (snow == 0) { dstyle.left = x+offsetx-(width/2)+"px";
dstyle.top = y+offsety+"px"; dstyle.visibility = "visible"; snow = 1; } } } //清除全面日期资料
function mout() { if ( cnt >= 1 ) { sw = 0; } if ( sw == 0 ) { snow = 0; if(dstyle)dstyle.visibility = "hidden";} else cnt++; } //取得位置
function mEvn(e) { e= e||window.event; x=e.clientx; y=e.clientY; if (document.body.scrollLeft) {x=event.x+document.body.scrollLeft; y=event.y+document.body.scrollTop;} if (snow){ dstyle.left = x+offsetx-(width/2);
dstyle.top = y+offsety; } } ///////////////////////////////////////////////////////////////////////////
function changeTZ() { CiTY.innerHTML = CLd.TZ.value.substr(6) setCookie("TZ",CLd.TZ.selectedindex) } function tick() { var today today = new date() Clock.innerHTML = getCndaystring(today); Clock2.innerHTML = getEndaystring(TimeAdd(new date(today.touTCstring().slice(0,-4)), CLd.TZ.value))+(blnsummerTime?"<FonT sTYLE='font-size:18pt;font-family:wingdings; color:red'>R</FonT>":""); setTimeout("tick()", 1000); } function setCookie(name, value) { var today = new date() var expires = new date() expires.setTime(today.getTime() + 1000*60*60*24*365) document.cookie = name + "=" + escape(value) + "; expires=" + expires.toGMTstring() } function getCookie(name) { var search = name + "="
if(document.cookie.length > 0) { offset = document.cookie.indexof(search) if(offset != -1) { offset += search.length end = document.cookie.indexof(";", offset) if(end == -1) end = document.cookie.length return unescape(document.cookie.substring(offset, end)) } else return "" } } function getCndaystring (dtmday) { return dtmday.getFullYear()+"年"+(dtmday.getMonth()+1)+"月"+dtmday.getdate()+"日 "+dtmday.getHours()+":"+((dtmday.getMinutes().tostring().length==1)?"0":"")+dtmday.getMinutes()+":"+((dtmday.getseconds().tostring().length==1)?"0":"")+dtmday.getseconds(); } function getEndaystring (dtmday) { return dtmday.getFullYear()+"-"+(dtmday.getMonth()+1)+"-"+dtmday.getdate()+" "+dtmday.getHours()+":"+((dtmday.getMinutes().tostring().length==1)?"0":"")+dtmday.getMinutes()+":"+((dtmday.getseconds().tostring().length==1)?"0":"")+dtmday.getseconds(); } function TimeAdd (uTC,T) { var plusMinus, y; if (T.charAt(0)=="-") { plusMinus = -1; } else { plusMinus = 1 } //alert(uTC)
//uTC=uTC.slice(4,uTC.length-4);
//alert(uTC)
y=uTC.getFullYear(); uTC.setMinutes(uTC.getMinutes()-(-T.slice(1,3)*60-T.slice(3,5))*plusMinus); //alert(uTC)
//美国国会于2005年通过扩大日光节约时间法案,将原来开始时间从4月的第一个星期日,提早到3月的第二个星期日;结束时间则从10月的最后一个星期日,延长到11月的第一个星期日。
var dtmdaylightsavingBegin,dtmdaylightsavingEnd; dtmdaylightsavingBegin = new date(y,3,0); dtmdaylightsavingBegin.setdate(dtmdaylightsavingBegin.getdate()+(7-dtmdaylightsavingBegin.getday())%7+7); dtmdaylightsavingEnd = new date(y,10,0); dtmdaylightsavingEnd.setdate(dtmdaylightsavingEnd.getdate()+(7-dtmdaylightsavingEnd.getday())%7); if (T.slice(5,6)=="*" && uTC>=dtmdaylightsavingBegin && uTC<=dtmdaylightsavingEnd) { uTC.setHours(uTC.getHours()+1); blnsummerTime = true; } return uTC; } /////////////////////////////////////////////////////////
function initial() { if (navigator.userAgent.indexof('MsiE')<0) { document.getElementByid("worldmap").innerHTML=""; } dstyle = detail.style; CLd.sY.selectedindex=tY-1900; CLd.sM.selectedindex=tM; drawCld(tY,tM); pushBtm(''); CLd.TZ.selectedindex=getCookie("TZ"); changeTZ(); tick(); } //-->
</script>
<style> .todyaColor { BACKGRound-CoLoR: aqua }
</style>
<meta content="MsHTML 6.00.2800.1505" name="GEnERAToR">
</head>
<body leftmargin="0" topmargin="0">
<script language="Javascript"> lck=0; function r(hval) { if ( lck == 0 ) { document.bgColor=hval; } } </script>
<p id="detail" style="posiTion: absolute">
</p>
<center>
<form name="CLd" onsubmit="return false">
<table>
<tbody>
<tr>
<td valign="top" align="middle">
<br>
<font style="FonT-siZE: 9pt" size="2">本机时间:</font><br>
<font id="Clock" face="Arial" color="#000080" size="4" align="center"></font>
<p>
<!--时区 *表示自动调整为日光节约时间--><font style="FonT-siZE: 9pt" size="2">
<select style="FonT-siZE: 9pt" onchange="changeTZ()" name="TZ">
<option value="-1200 安尼威土克、瓜甲兰" selected>国际换日线 <option value="-1100 中途岛、萨摩亚群岛">萨摩亚 <option value="-1000 夏威夷">夏威夷 <option value="-0900*阿拉斯加">阿拉斯加 <option value="-0800*太平洋时间(美加)、提亚纳">太平洋 <option value="-0700*亚历桑那">美国山区 <option value="-0700*山区时间(美加)">美加山区 <option value="-0600*萨克其万(加拿大)">加拿大中部 <option value="-0600*墨西哥市、塔克西卡帕">墨西哥 <option value="-0600*中部时间(美加)">美加中部 <option value="-0500*波哥大、里玛">南美洲太平洋 <option value="-0500*东部时间(美加)">美加东部 <option value="-0500*印第安纳(东部)">美东 <option value="-0400*加拉卡斯、拉帕兹">南美洲西部 <option value="-0400*大西洋时间 加拿大)">大西洋 <option value="-0330 新岛(加拿大东岸)">纽芬兰 <option value="-0300 波西尼亚">东南美洲 <option value="-0300 布鲁诺斯爱丽斯、乔治城">南美洲东部 <option value="-0200*大西洋中部">大西洋中部 <option value="-0100*亚速尔群岛、维德角群岛">亚速尔 <option value="+0000 格林威治时间、都柏林、爱丁堡、伦敦">英国夏令 <option value="+0000 莫洛维亚(赖比瑞亚)、卡萨布兰卡">格林威治标准 <option value="+0100 巴黎、马德里">罗马 <option value="+0100 布拉格, 华沙, 布达佩斯">中欧 <option value="+0100 柏林、斯德哥尔摩、罗马、伯恩、布鲁赛尔、维也纳">西欧 <option value="+0200 以色列">以色列 <option value="+0200*东欧">东欧 <option value="+0200*开罗">埃及 <option value="+0200*雅典、赫尔辛基、伊斯坦堡">GFT <option value="+0200*赫拉雷、皮托里">南非 <option value="+0300*巴格达、科威特、奈洛比(肯亚)、里雅德(沙乌地)">沙乌地阿拉伯 <option value="+0300*莫斯科、圣彼得堡、贺占、窝瓦格瑞德">俄罗斯 <option value="+0330*德黑兰">伊朗 <option value="+0400*阿布达比(东阿拉伯)、莫斯凯、塔布理斯(乔治亚共和)">阿拉伯 <option value="+0430*喀布尔">阿富汗 <option value="+0500 伊斯兰马巴德、克洛奇、伊卡特林堡、塔须肯">西亚 <option value="+0530 孟买、加尔各答、马垂斯、新德里、可伦坡">印度 <option value="+0600 阿马提、达卡">中亚 <option value="+0700 曼谷、亚加达、胡志明市">曼谷 <option value="+0800 北京、重庆、黑龙江">中国 <option value="+0800 台湾、香港、新加坡">台北 <option value="+0900 东京、大阪、扎幌、汉城、亚库兹(东西伯利亚)">东京 <option value="+0930 达尔文">澳洲中部 <option value="+1000 布里斯本、墨尔本、席德尼">席德尼 <option value="+1000 霍巴特">塔斯梅尼亚 <option value="+1000 关岛、莫斯比港、海 威">西太平洋 <option value="+1100*马哥大、所罗门群岛、新卡伦多尼亚">太平洋中部 <option value="+1200 威灵顿、奥克兰">纽西兰 <option value="+1200 斐济、肯加塔、马歇尔群岛">斐济</option>
</select> 时间 </font><br>
<font id="Clock2" face="Arial" color="#000080" size="4" align="center"></font><br>
<font style="FonT-siZE: 120pt; CoLoR: green; FonT-FAMiLY:webdings" id="worldmap">û</font><br>
<font id="CiTY" style="FonT-siZE: 9pt; widTH: 150px; CoLoR: blue; FonT-FAMiLY: '新细明体'"></font>
</p>
</td>
<td align="middle">
<p style="Z-indEx: -1; posiTion: absolute; Top: 30px">
<font id="YMBG" style="FonT-siZE: 90pt; CoLoR: #f0f0f0; FonT-FAMiLY: 'Arial Black'"> 0000<br>
Jun</font>
</p>
<table border="0">
<tbody>
<tr>
<td bgcolor="#000080" colspan="7">
<font style="FonT-siZE: 9pt" color="#ffffff" size="2">公历 <select style="FonT-siZE: 9pt" onchange="changeCld()" name="sY">
<script language="Javascript"><!--
for(i=1900;i<2050;i++) document.write('<option>'+i) //--></script>
</select>
年 <select style="FonT-siZE: 9pt" onchange="changeCld()" name="sM">
<script language="Javascript"><!--
for(i=1;i<13;i++) document.write('<option>'+i) //--></script>
</select>
月 </font><font id="GZ" face="标楷体" color="yellow" size="3"></font><br>
</td>
</tr>
<tr align="middle" bgcolor="#e0e0e0">
<td width="60">
<font color="red">日</font>
</td>
<td width="60"> 一 </td>
<td width="60"> 二 </td>
<td width="60"> 三 </td>
<td width="60"> 四 </td>
<td width="60"> 五 </td>
<td width="60">
<font color="green">六</font>
</td>
</tr>
<script language="Javascript"><!--
var gnum for(i=0;i<6;i++) { document.write('<tr align="center">') for(j=0;j<7;j++) { gnum = i*7+j document.write('<td id="Gd' + gnum +'" onm ouseover="movr(' + gnum +')" onm ouseout="mout()"><font id="wT' + gnum + '" class="wT"></font><font id="sd' + gnum +'" class="sd"') if(j == 0) document.write(' color=red') if(j == 6) if(i%2==1) document.write(' color=red') else document.write(' color=green') document.write(' TiTLE=""> </font><br><font id="Ld' + gnum + '" size=2 style="font-size:9pt"> </font></td>') } document.write('</tr>') } //--></script>
</tbody>
</table>
</td>
<td valign="top" align="middle" width="40">
<br>
<br>
<br>
<br>
<button style="FonT-siZE: 9pt" onclick="pushBtm('Yu')">年↑</button><br>
<button style="FonT-siZE: 9pt" onclick="pushBtm('Yd')">年↓</button>
<p>
<button style="FonT-siZE: 9pt" onclick="pushBtm('Mu')">月↑</button><br>
<button style="FonT-siZE: 9pt" onclick="pushBtm('Md')">月↓</button>
<p>
<button style="FonT-siZE: 9pt" onclick="pushBtm('')">今日</button>
</p>
</td>
</tr>
</tbody>
</table>
</form>
<p>
</p>
<hr width="90%" color="#cccccc" noshade size="1">
<font style="FonT-siZE: 9pt" face="ARiAL" size="2">阳历中<font color="red">红色</font>/<font color="green">官方</font><font color="black">表示节假日,农历中<font color="green">官方</font>表示为24节气日,<font color="red">红色</font>表示为传统节日,<font color="blue">蓝色</font>则表示为公众节假日<br>
<script type="text/javascript">
<!-- initial() //-->
</script>
</center>
<br>
<table align="center" border="0" cellpadding="3" cellspacing="0" width="700">
<tr>
<td align="center">
<b><font color="#008000"></font></b>
</td>
</tr>
</table>
</body>
</html>
把上述代码保存为html文件
本站发布的系统与软件仅为个人学习测试使用,不得用于任何商业用途,否则后果自负,请支持购买微软正版软件!
Copyright @ 2022 大师系统版权所有