<!-- function LoadMap( parm ) { return window.open( '/maps/index.asp' + parm, 'MapWindows', 'toolbar=0,location=0,directories=0,status=1,menuBar=1,scrollBars=1,resizable=1' ); } function CalConv() { FIRSTYEAR = 1998; LASTYEAR = 2031; today = new Date(); SolarYear = today.getFullYear(); SolarMonth = today.getMonth() + 1; SolarDate = today.getDate(); Weekday = today.getDay(); LunarCal = [ new tagLunarCal( 27, 5, 3, 43, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1 ), new tagLunarCal( 46, 0, 4, 48, 1, 0, 0, 1, 0, 0, 1, 0, 1, 1, 1, 0, 1 ), /* 1999 */ new tagLunarCal( 35, 0, 5, 53, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1 ), /* 2000 */ new tagLunarCal( 23, 4, 0, 59, 1, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1 ), new tagLunarCal( 42, 0, 1, 4, 1, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1 ), new tagLunarCal( 31, 0, 2, 9, 1, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0 ), new tagLunarCal( 21, 2, 3, 14, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1 ), /* 2004 */ new tagLunarCal( 39, 0, 5, 20, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1 ), new tagLunarCal( 28, 7, 6, 25, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1 ), new tagLunarCal( 48, 0, 0, 30, 0, 0, 1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1 ), new tagLunarCal( 37, 0, 1, 35, 1, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1 ), /* 2008 */ new tagLunarCal( 25, 5, 3, 41, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1 ), new tagLunarCal( 44, 0, 4, 46, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1 ), new tagLunarCal( 33, 0, 5, 51, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1 ), new tagLunarCal( 22, 4, 6, 56, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0 ), /* 2012 */ new tagLunarCal( 40, 0, 1, 2, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0 ), new tagLunarCal( 30, 9, 2, 7, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1 ), new tagLunarCal( 49, 0, 3, 12, 0, 1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1 ), new tagLunarCal( 38, 0, 4, 17, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0 ), /* 2016 */ new tagLunarCal( 27, 6, 6, 23, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 1 ), new tagLunarCal( 46, 0, 0, 28, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0 ), new tagLunarCal( 35, 0, 1, 33, 0, 1, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0 ), new tagLunarCal( 24, 4, 2, 38, 0, 1, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1 ), /* 2020 */ new tagLunarCal( 42, 0, 4, 44, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1 ), new tagLunarCal( 31, 0, 5, 49, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0 ), new tagLunarCal( 21, 2, 6, 54, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1 ), new tagLunarCal( 40, 0, 0, 59, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1 ), /* 2024 */ new tagLunarCal( 28, 6, 2, 5, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0 ), new tagLunarCal( 47, 0, 3, 10, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1 ), new tagLunarCal( 36, 0, 4, 15, 1, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1 ), new tagLunarCal( 25, 5, 5, 20, 1, 1, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0 ), /* 2028 */ new tagLunarCal( 43, 0, 0, 26, 1, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1 ), new tagLunarCal( 32, 0, 1, 31, 1, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 0 ), new tagLunarCal( 22, 3, 2, 36, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0 ) ]; /* 西历年每月之日数 */ SolarCal = [ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 ]; /* 西历年每月之累积日数, 平年与闰年 */ SolarDays = [ 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365, 396, 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366, 397 ]; AnimalIdx = ["马", "羊", "猴", "鸡", "狗", "猪", "鼠", "牛", "虎", "兔", "龙", "蛇" ]; LocationIdx = [ "南", "东", "北", "西" ]; if ( SolarYear <= FIRSTYEAR || SolarYear > LASTYEAR ) return 1; sm = SolarMonth - 1; if ( sm < 0 || sm > 11 ) return 2; leap = GetLeap( SolarYear ); if ( sm == 1 ) d = leap + 28; else d = SolarCal[sm]; if ( SolarDate < 1 || SolarDate > d ) return 3; y = SolarYear - FIRSTYEAR; acc = SolarDays[ leap*14 + sm ] + SolarDate; kc = acc + LunarCal[y].BaseKanChih; Kan = kc % 10; Chih = kc % 12; Location = LocationIdx[kc % 4]; Age = kc % 60; if ( Age < 22 ) Age = 22 - Age; else Age = 82 - Age; Animal = AnimalIdx[ Chih ]; if ( acc <= LunarCal[y].BaseDays ) { y--; LunarYear = SolarYear - 1; leap = GetLeap( LunarYear ); sm += 12; acc = SolarDays[leap*14 + sm] + SolarDate; } else LunarYear = SolarYear; l1 = LunarCal[y].BaseDays; for ( i=0; i<13; i++ ) { l2 = l1 + LunarCal[y].MonthDays + 29; if ( acc <= l2 ) break; l1 = l2; } LunarMonth = i + 1; LunarDate = acc - l1; im = LunarCal[y].Intercalation; if ( im != 0 && LunarMonth > im ) { LunarMonth--; if ( LunarMonth == im ) LunarMonth = -im; } if ( LunarMonth > 12 ) LunarMonth -= 12; myday = today.getDay(); if(myday == 0) day = " 星 期 日" else if(myday == 1) day = " 星 期 一" else if(myday == 2) day = " 星 期 二" else if(myday == 3) day = " 星 期 三" else if(myday == 4) day = " 星 期 四" else if(myday == 5) day = " 星 期 五" else if(myday == 6) day = " 星 期 六" document.write("<font style='font-SIZE:12pt;font-family:宋体,Arial'>"+SolarYear+"年"+SolarMonth+"月</FONT><br>"); document.write("<b><font style='font-SIZE:18pt;line-height: 26pt;font-family:宋体,Arial' color=#FF0000>"+SolarDate+"</font></b><br>"); document.write("<font style='font-SIZE:9pt;font-family:宋体,Arial'>"+day+"</font><br>"); document.write("<font style='font-SIZE:10.5pt;font-family:宋体,Arial' color=#82841C>农历"+LunarMonth+"月"+LunarDate+"日</font><br>" );
if ((LunarMonth == 1) && (LunarDate == 1)) document.write("<a href='main/jnr/0101.htm' target='_blank'><font face=Arial size=2 color=#0000ff>弥勒菩萨圣诞</font></a>"); if ((LunarMonth == 1) && (LunarDate == 6)) document.write("<a href='main/jnr/0106.htm' target='_blank'><font face=Arial size=2 color=#0000ff>定光佛圣诞</font></a>"); if ((LunarMonth == 1) && (LunarDate == 12)) document.write("<a href='main/jnr/0112.htm' target='_blank'><font face=Arial size=2 color=#0000ff>净宗七祖省常法师圆寂日</font></a>"); if ((LunarMonth == 1) && (LunarDate == 15)) document.write("<a href='main/jnr/0115.htm' target='_blank'><font face=Arial size=2 color=#0000ff>元宵节</font></a>"); if ((LunarMonth == 1) && (LunarDate == 21)) document.write("<a href='main/jnr/0121.htm' target='_blank'><font face=Arial size=2 color=#0000ff>净宗九祖蕅益法师圆寂日</font></a>"); if ((LunarMonth == 1) && (LunarDate == 22)) document.write("<a href='main/jnr/0121.htm' target='_blank'><font face=Arial size=2 color=#0000ff>见月律师往生</font></a>"); if ((LunarMonth == 2) && (LunarDate == 2)) document.write("<a href='main/jnr/0203.htm' target='_blank'><font face=Arial size=2 color=#0000ff>太虚大师往生</font></a>"); if ((LunarMonth == 2) && (LunarDate == 3)) document.write("<a href='main/jnr/0203.htm' target='_blank'><font face=Arial size=2 color=#0000ff>文昌帝君诞辰</font></a>"); if ((LunarMonth == 2) && (LunarDate == 5)) document.write("<a href='main/jnr/0203.htm' target='_blank'><font face=Arial size=2 color=#0000ff>玄奘三藏法师往生</font></a>"); if ((LunarMonth == 2) && (LunarDate == 8)) document.write("<a href='main/jnr/0208.htm' target='_blank'><font face=Arial size=2 color=#0000ff>释迦佛出家日,印手菩萨涅槃</font></a>"); if ((LunarMonth == 2) && (LunarDate == 9)) document.write("<a href='main/jnr/0209.htm' target='_blank'><font face=Arial size=2 color=#0000ff>六祖慧能圣诞</font></a>"); if ((LunarMonth == 2) && (LunarDate == 11)) document.write("<a href='main/jnr/0209.htm' target='_blank'><font face=Arial size=2 color=#0000ff>贞诲法师往生</font></a>"); if ((LunarMonth == 2) && (LunarDate == 15)) document.write("<a href='main/jnr/0215.htm' target='_blank'><font face=Arial size=2 color=#0000ff>释迦佛涅槃日,弥勒菩萨涅槃</font></a>"); if ((LunarMonth == 2) && (LunarDate == 19)) document.write("<a href='main/jnr/0219.htm' target='_blank'><font face=Arial size=2 color=#0000ff>观世音菩萨诞辰</font></a>"); if ((LunarMonth == 2) && (LunarDate == 21)) document.write("<a href='main/jnr/0221.htm' target='_blank'><font face=Arial size=2 color=#0000ff>普贤菩萨圣诞</font></a>"); if ((LunarMonth == 2) && (LunarDate == 26)) document.write("<a href='main/jnr/0226.htm' target='_blank'><font face=Arial size=2 color=#0000ff>净宗六祖永明法师圆寂日</font></a>"); if ((LunarMonth == 3) && (LunarDate == 3)) document.write("<a href='main/jnr/0316.htm' target='_blank'><font face=Arial size=2 color=#0000ff>布袋和尚坐化</font></a>"); if ((LunarMonth == 3) && (LunarDate == 16)) document.write("<a href='main/jnr/0316.htm' target='_blank'><font face=Arial size=2 color=#0000ff>准提菩萨圣诞</font></a>"); if ((LunarMonth == 3) && (LunarDate == 18)) document.write("<a href='main/jnr/0316.htm' target='_blank'><font face=Arial size=2 color=#0000ff>昙衍法师往生</font></a>"); if ((LunarMonth == 4) && (LunarDate == 4)) document.write("<a href='main/jnr/0404.htm' target='_blank'><font face=Arial size=2 color=#0000ff>文殊菩萨圣诞,慈航菩萨涅槃 </font></a>"); if ((LunarMonth == 4) && (LunarDate == 8)) document.write("<a href='main/jnr/0408.htm' target='_blank'><font face=Arial size=2 color=#0000ff>释迦文佛圣诞,道宣律师诞辰</font></a>"); if ((LunarMonth == 4) && (LunarDate == 14)) document.write("<a href='main/jnr/0414.htm' target='_blank'><font face=Arial size=2 color=#0000ff>净宗十一祖省庵法师圆寂日</font></a>"); if ((LunarMonth == 4) && (LunarDate == 24)) document.write("<a href='main/jnr/0428.htm' target='_blank'><font face=Arial size=2 color=#0000ff>善慧菩萨涅槃</font></a>"); if ((LunarMonth == 4) && (LunarDate == 28)) document.write("<a href='main/jnr/0428.htm' target='_blank'><font face=Arial size=2 color=#0000ff>药王菩萨圣诞</font></a>"); if ((LunarMonth == 5) && (LunarDate == 5)) document.write("<a href='main/jnr/0505.htm' target='_blank'><font face=Arial size=2 color=#0000ff>端午节</font></a>"); if ((LunarMonth == 5) && (LunarDate == 8)) document.write("<a href='main/jnr/0505.htm' target='_blank'><font face=Arial size=2 color=#0000ff>善慧菩萨圣诞</font></a>"); if ((LunarMonth == 5) && (LunarDate == 13)) document.write("<a href='main/jnr/0513.htm' target='_blank'><font face=Arial size=2 color=#0000ff>伽蓝菩萨圣诞</font></a>"); if ((LunarMonth == 5) && (LunarDate == 30)) document.write("<a href='main/jnr/0513.htm' target='_blank'><font face=Arial size=2 color=#0000ff>弘赞律师诞辰</font></a>"); if ((LunarMonth == 6) && (LunarDate == 3)) document.write("<a href='main/jnr/0603.htm' target='_blank'><font face=Arial size=2 color=#0000ff>韦驮菩萨圣诞,法因法师往生</font></a>"); if ((LunarMonth == 6) && (LunarDate == 5)) document.write("<a href='main/jnr/0603.htm' target='_blank'><font face=Arial size=2 color=#0000ff>鸿楚法师往生</font></a>"); if ((LunarMonth == 6) && (LunarDate == 19)) document.write("<a href='main/jnr/0619.htm' target='_blank'><font face=Arial size=2 color=#0000ff>观世音菩萨得道</font></a>"); if ((LunarMonth == 7) && (LunarDate == 2)) document.write("<a href='main/jnr/0702.htm' target='_blank'><font face=Arial size=2 color=#0000ff>净宗八祖莲池法师圆寂日 </font></a>"); if ((LunarMonth == 7) && (LunarDate == 9)) document.write("<a href='main/jnr/0709.htm' target='_blank'><font face=Arial size=2 color=#0000ff>净宗十祖截流法师圆寂日 </font></a>"); if ((LunarMonth == 7) && (LunarDate == 13)) document.write("<a href='main/jnr/0713.htm' target='_blank'><font face=Arial size=2 color=#0000ff>大势至菩萨圣诞</font></a>"); if ((LunarMonth == 7) && (LunarDate == 15)) document.write("<a href='main/jnr/0715.htm' target='_blank'><font face=Arial size=2 color=#0000ff>佛欢喜日</font></a>"); if ((LunarMonth == 7) && (LunarDate == 18)) document.write("<a href='main/jnr/0715.htm' target='_blank'><font face=Arial size=2 color=#0000ff>法上国师往生</font></a>"); if ((LunarMonth == 7) && (LunarDate == 19)) document.write("<a href='main/jnr/0719.htm' target='_blank'><font face=Arial size=2 color=#0000ff>净宗三祖承远法师圆寂日</font></a>");
if ((LunarMonth == 7) && (LunarDate == 21)) document.write("<a href='main/jnr/0721.htm' target='_blank'><font face=Arial size=2 color=#0000ff>普庵祖师圣诞</font></a>"); if ((LunarMonth == 7) && (LunarDate == 24)) document.write("<a href='main/jnr/0724.htm' target='_blank'><font face=Arial size=2 color=#0000ff>龙树菩萨圣诞,彦琮法师往生</font></a>"); if ((LunarMonth == 7) && (LunarDate == 29)) document.write("<a href='main/jnr/0724.htm' target='_blank'><font face=Arial size=2 color=#0000ff>虚云和尚诞辰</font></a>"); if ((LunarMonth == 7) && (LunarDate == 30)) document.write("<a href='main/jnr/0730.htm' target='_blank'><font face=Arial size=2 color=#0000ff>地藏菩萨圣诞</font></a>"); if ((LunarMonth == 8) && (LunarDate == 6)) document.write("<a href='main/jnr/0806.htm' target='_blank'><font face=Arial size=2 color=#0000ff>净宗初祖慧远法师圆寂日</font></a>"); if ((LunarMonth == 8) && (LunarDate == 7)) document.write("<a href='main/jnr/0806.htm' target='_blank'><font face=Arial size=2 color=#0000ff>慈航菩萨圣诞</font></a>"); if ((LunarMonth == 8) && (LunarDate == 15)) document.write("<a href='main/jnr/0815.htm' target='_blank'><font face=Arial size=2 color=#0000ff>中秋节,记得持斋诵戒!</font></a>"); if ((LunarMonth == 8) && (LunarDate == 22)) document.write("<a href='main/jnr/0822.htm' target='_blank'><font face=Arial size=2 color=#0000ff>燃灯佛圣诞</font></a>"); if ((LunarMonth == 9) && (LunarDate == 4)) document.write("<a href='main/jnr/0904.htm' target='_blank'><font face=Arial size=2 color=#0000ff>弘一法师圆寂日</font></a>"); if ((LunarMonth == 9) && (LunarDate == 9)) document.write("<a href='main/jnr/0909.htm' target='_blank'><font face=Arial size=2 color=#0000ff>重阳节</font></a>"); if ((LunarMonth == 9) && (LunarDate == 12)) document.write("<a href='main/jnr/0909.htm' target='_blank'><font face=Arial size=2 color=#0000ff>虚云和尚往生</font></a>"); if ((LunarMonth == 9) && (LunarDate == 19)) document.write("<a href='main/jnr/0919.htm' target='_blank'><font face=Arial size=2 color=#0000ff>观音菩萨出家纪念日</font></a>"); if ((LunarMonth == 9) && (LunarDate == 20)) document.write("<a href='main/jnr/0920.htm' target='_blank'><font face=Arial size=2 color=#0000ff>弘一法师诞辰</font></a>"); if ((LunarMonth == 9) && (LunarDate == 29)) document.write("<a href='main/jnr/0929.htm' target='_blank'><font face=Arial size=2 color=#0000ff>药师佛圣诞</font></a>"); if ((LunarMonth == 10) && (LunarDate == 3)) document.write("<a href='main/jnr/1003.htm' target='_blank'><font face=Arial size=2 color=#0000ff>净宗五祖少康法师圆寂日,道宣律师往生</font></a>"); if ((LunarMonth == 10) && (LunarDate == 5)) document.write("<a href='main/jnr/1005.htm' target='_blank'><font face=Arial size=2 color=#0000ff>达摩祖师诞辰</font></a>"); if ((LunarMonth == 10) && (LunarDate == 10)) document.write("<a href='main/jnr/1010.htm' target='_blank'><font face=Arial size=2 color=#0000ff>宗喀巴祖师诞辰</font></a>"); if ((LunarMonth == 10) && (LunarDate == 16)) document.write("<a href='main/jnr/1010.htm' target='_blank'><font face=Arial size=2 color=#0000ff>法忍禅师往生</font></a>"); if ((LunarMonth == 10) && (LunarDate == 25)) document.write("<a href='main/jnr/1025.htm' target='_blank'><font face=Arial size=2 color=#0000ff>宗喀巴大师圆寂日</font></a>"); if ((LunarMonth == 11) && (LunarDate == 17)) document.write("<a href='main/jnr/1117.htm' target='_blank'><font face=Arial size=2 color=#0000ff>阿弥陀佛圣诞,又净宗二祖善导法师圆寂日</font></a>"); if ((LunarMonth == 11) && (LunarDate == 13)) document.write("<a href='main/jnr/1117.htm' target='_blank'><font face=Arial size=2 color=#0000ff>窥基大师往生</font></a>"); if ((LunarMonth == 12) && (LunarDate == 1)) document.write("<a href='main/jnr/1201.htm' target='_blank'><font face=Arial size=2 color=#0000ff>净宗四祖法照法师圆寂日</font></a>"); if ((LunarMonth == 12) && (LunarDate == 3)) document.write("<a href='main/jnr/1203.htm' target='_blank'><font face=Arial size=2 color=#0000ff>净宗十三祖印光法师圆寂日</font></a>"); if ((LunarMonth == 12) && (LunarDate == 8)) document.write("<a href='main/jnr/1208.htm' target='_blank'><font face=Arial size=2 color=#0000ff>釋迦牟尼佛成道紀念日</font></a>"); if ((LunarMonth == 12) && (LunarDate == 17)) document.write("<a href='main/jnr/1217.htm' target='_blank'><font face=Arial size=2 color=#0000ff>净宗十二祖彻悟法师圆寂日,紫柏尊者往生</font></a>"); if ((LunarMonth == 12) && (LunarDate == 18)) document.write("<a href='main/jnr/1217.htm' target='_blank'><font face=Arial size=2 color=#0000ff>太虚大师诞辰</font></a>"); if ((LunarMonth == 12) && (LunarDate == 29)) document.write("<a href='main/jnr/1229.htm' target='_blank'><font face=Arial size=2 color=#0000ff>华严菩萨圣诞 </font></a>"); //--> return 0; } /* 求此西历年是否为闰年, 返回 0 为平年, 1 为闰年 */ function GetLeap( year ) { if ( year % 400 == 0 ) return 1; else if ( year % 100 == 0 ) return 0; else if ( year % 4 == 0 ) return 1; else return 0; } function tagLunarCal( d, i, w, k, m1, m2, m3, m4, m5, m6, m7, m8, m9, m10, m11, m12, m13) { this.BaseDays = d; /* 到西历 1 月 1 日到农历正月初一的累积日数 */ this.Intercalation = i; /* 闰月月份. 0==此年没有闰月 */ this.BaseWeekday = w; /* 此年西历 1 月 1 日为星期几再减 1 */ this.BaseKanChih = k; /* 此年西历 1 月 1 日之干支序号减 1 */ this.MonthDays = [ m1, m2, m3, m4, m5, m6, m7, m8, m9, m10, m11, m12, m13 ]; /* 此农历年每月之大小, 0==小月(29日), 1==大月(30日) */ } //--> CalConv(); <!-- function OpenWin( url ) { return window.open( url, 'coop', 'width=320,height=350,toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=0,resizable=1' ); } //--> 保存为JS文件调用. 例如 <script language="JavaScript" src="date.js"></script>