阴阳历转换

<!--
function CalConv(M)
 {

 FIRSTYEAR = 1936;
 LASTYEAR = 2031;

 LunarCal = [
  new tagLunarCal(23, 3, 2, 17, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0 ), /* 1936 */
  new tagLunarCal( 41, 0, 4, 23, 1, 0, 0, 1, 0, 0, 1, 0, 1, 1, 1, 0, 1 ),
  new tagLunarCal( 30, 7, 5, 28, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1 ),
  new tagLunarCal( 49, 0, 6, 33, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1 ),
  new tagLunarCal( 38, 0, 0, 38, 1, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1 ), /* 1940 */
  new tagLunarCal( 26, 6, 2, 44, 1, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0 ),
  new tagLunarCal( 45, 0, 3, 49, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0 ),
  new tagLunarCal( 35, 0, 4, 54, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1 ),
  new tagLunarCal( 24, 4, 5, 59, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1 ), /* 1944 */
  new tagLunarCal( 43, 0, 0, 5, 0, 0, 1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1 ),
  new tagLunarCal( 32, 0, 1, 10, 1, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1 ),
  new tagLunarCal( 21, 2, 2, 15, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1 ),
  new tagLunarCal( 40, 0, 3, 20, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1 ), /* 1948 */
  new tagLunarCal( 28, 7, 5, 26, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1 ),
  new tagLunarCal( 47, 0, 6, 31, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1 ),
  new tagLunarCal( 36, 0, 0, 36, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0 ),
  new tagLunarCal( 26, 5, 1, 41, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1 ), /* 1952 */
  new tagLunarCal( 44, 0, 3, 47, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1 ),
  new tagLunarCal( 33, 0, 4, 52, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0 ),
  new tagLunarCal( 23, 3, 5, 57, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 1 ),
  new tagLunarCal( 42, 0, 6, 2, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 1 ), /* 1956 */
  new tagLunarCal( 30, 8, 1, 8, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0 ),
  new tagLunarCal( 48, 0, 2, 13, 1, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0 ),
  new tagLunarCal( 38, 0, 3, 18, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1 ),
  new tagLunarCal( 27, 6, 4, 23, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0 ), /* 1960 */
  new tagLunarCal( 45, 0, 6, 29, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0 ),
  new tagLunarCal( 35, 0, 0, 34, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1 ),
  new tagLunarCal( 24, 4, 1, 39, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0 ),
  new tagLunarCal( 43, 0, 2, 44, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0 ), /* 1964 */
  new tagLunarCal( 32, 0, 4, 50, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1 ),
  new tagLunarCal( 20, 3, 5, 55, 1, 1, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0 ),
  new tagLunarCal( 39, 0, 6, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0 ),
  new tagLunarCal( 29, 7, 0, 5, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1 ), /* 1968 */
  new tagLunarCal( 47, 0, 2, 11, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1 ),
  new tagLunarCal( 36, 0, 3, 16, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0 ),
  new tagLunarCal( 26, 5, 4, 21, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1 ),
  new tagLunarCal( 45, 0, 5, 26, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1 ), /* 1972 */
  new tagLunarCal( 33, 0, 0, 32, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1 ),
  new tagLunarCal( 22, 4, 1, 37, 1, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1 ),
  new tagLunarCal( 41, 0, 2, 42, 1, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 1 ),
  new tagLunarCal( 30, 8, 3, 47, 1, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1 ), /* 1976 */
  new tagLunarCal( 48, 0, 5, 53, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1 ),
  new tagLunarCal( 37, 0, 6, 58, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1 ),
  new tagLunarCal( 27, 6, 0, 3, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0 ),
  new tagLunarCal( 46, 0, 1, 8, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0 ), /* 1980 */
  new tagLunarCal( 35, 0, 3, 14, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 1 ),
  new tagLunarCal( 24, 4, 4, 19, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 1, 1 ),
  new tagLunarCal( 43, 0, 5, 24, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 1, 1 ),
  new tagLunarCal( 32, 10, 6, 29, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 1 ), /* 1984 */
  new tagLunarCal( 50, 0, 1, 35, 0, 1, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0 ),
  new tagLunarCal( 39, 0, 2, 40, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 0, 0, 1 ),
  new tagLunarCal( 28, 6, 3, 45, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 0 ),
  new tagLunarCal( 47, 0, 4, 50, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1 ), /* 1988 */
  new tagLunarCal( 36, 0, 6, 56, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0 ),
  new tagLunarCal( 26, 5, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 1, 1, 1 ),
  new tagLunarCal( 45, 0, 1, 6, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 1, 1, 0 ),
  new tagLunarCal( 34, 0, 2, 11, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0 ), /* 1992 */
  new tagLunarCal( 22, 3, 4, 17, 0, 1, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0 ),
  new tagLunarCal( 40, 0, 5, 22, 1, 1, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0 ),
  new tagLunarCal( 30, 8, 6, 27, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1 ),
  new tagLunarCal( 49, 0, 0, 32, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 1 ), /* 1996 */
  new tagLunarCal( 37, 0, 2, 38, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1 ),
  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 (M==0) {  //阳历到阴历
if (!IsInteger(form_jisuan.yyear.value) || !IsInteger(form_jisuan.ymonth.value) || !IsInteger(form_jisuan.yday.value)) return alert("请输入合法阳历年月日数值");
 SolarYear = parseInt(form_jisuan.yyear.value);
 SolarMonth = parseInt(form_jisuan.ymonth.value);
 SolarDate = parseInt(form_jisuan.yday.value);

 if ( SolarYear <= FIRSTYEAR || SolarYear > LASTYEAR ) return alert("请输入1936-2031有效年份"); 

 sm = SolarMonth - 1;

 if ( sm < 0 || sm > 11 ) return alert("请输入有效月份");

 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;

 Age =Age + 3;

if (Age < 10)
  Age=Age+60;

 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[i] + 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;

    //alert("农历/阴历日期为:"+ LunarYear + "年" + LunarMonth + "月" + LunarDate + "日" );

    var showgn = 0;
    showgn = "农历(阴历)日期为:"+ LunarYear + "年" + LunarMonth + "月" + LunarDate + "日";
    document.form_jisuan.g2n.value=showgn;
            //form_jisuan.yyear.value = "";
            //form_jisuan.ymonth.value = "";
            //form_jisuan.yday.value = "";
 return 0;
 }

 else /* 阴历转阳历 */
 {
   if (!IsInteger(form_jisuan.nyear.value) || !IsInteger(form_jisuan.nmonth.value) || !IsInteger(form_jisuan.nday.value)) return alert("请输入合法农历年月日数值");
   LunarYear = parseInt(form_jisuan.nyear.value);
   LunarMonth = parseInt(form_jisuan.nmonth.value);
   LunarDate = parseInt(form_jisuan.nday.value);

        if ( LunarYear < FIRSTYEAR || LunarYear >= LASTYEAR ) return alert("请输入1936-2031有效年份");   

        y = LunarYear - FIRSTYEAR ;
        im = LunarCal[y].Intercalation;
        lm = LunarMonth; 

        if ( lm < 0 )
        {
            if ( lm != -im )
                return alert("请输入有效月份");
        }
        else if ( lm < 1 || lm > 12 ) return alert("请输入有效月份");   

        if ( im != 0 )
        {
            if ( lm > im )
                lm++;
            else if ( lm == -im )
                lm = im + 1;
        }
        lm--; 

        if ( LunarDate > LunarCal[y].MonthDays[lm] + 29 )
            return alert("农历日期不正确");

        acc = 0;
        for ( i=0; i < lm;i++) {

         acc+= LunarCal[y].MonthDays[i] + 29;

       }

        acc +=LunarCal[y].BaseDays + LunarDate;

            leap = GetLeap( LunarYear ); 

        for ( i=13; i>=0; i-- ) {

            if ( acc > SolarDays[leap*14+i] )
                break;
        }
             SolarDate = acc - SolarDays[leap*14 + i]  ;

            if ( i <= 11 )
            { 

                SolarYear = LunarYear;
                SolarMonth = i + 1;
            }
            else
            { 

                SolarYear = LunarYear + 1;
                SolarMonth = i - 11;
            } 

            leap = GetLeap( SolarYear );
            y = SolarYear - FIRSTYEAR; 

            //acc = SolarDays[leap][SolarMonth-1] + SolarDate;
            acc = SolarDays[leap*14 + SolarMonth-1] + SolarDate;

            weekday = ( acc + LunarCal[y].BaseWeekday ) % 7;
            kc = acc + LunarCal[y].BaseKanChih;
            kan = kc % 10;
            chih = kc % 12; 

            //alert("公历/阳历日期为:"+ SolarYear + "年" + SolarMonth + "月" + SolarDate + "日" );        

    var showng = 0;
    showng = "公历(阳历)日期为:"+ SolarYear + "年" + SolarMonth + "月" + SolarDate + "日";
    document.form_jisuan.n2g.value=showng;

            //form_jisuan.nyear.value = "";
            //form_jisuan.nmonth.value = "";
            //form_jisuan.nday.value = "";
            return 0;
 }//else结束

 }

 /* 闰年, 返回 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日) */
}

//-->

<!--
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‘ );
} 

function IsInteger(string ,sign)
{
  var integer;
  if ((sign!=null) && (sign!=‘-‘) && (sign!=‘+‘))
  {
   alert(‘IsInter(string,sign)的参数出错:nsign为null或"-"或"+"‘);
   return false;
  }
  integer = parseInt(string);
  if (isNaN(integer))
  {
   return false;
  }
  else if (integer.toString().length==string.length)
  {
   if ((sign==null) || (sign==‘-‘ && integer<0) || (sign==‘+‘ && integer>0))
   {
     return true;
   }
   else
     return false;
  }
  else
   return false;
} 

//-->

  

<label>请选择阳历日期</label>

<select size="1" name="yyear" class="select">
<option value="1937">1937</option><option value="1938">1938</option><option value="1939">1939</option><option value="1940">1940</option><option value="1941">1941</option><option value="1942">1942</option><option value="1943">1943</option><option value="1944">1944</option><option value="1945">1945</option><option value="1946">1946</option><option value="1947">1947</option><option value="1948">1948</option><option value="1949">1949</option><option value="1950">1950</option><option value="1951">1951</option><option value="1952">1952</option><option value="1953">1953</option><option value="1954">1954</option><option value="1955">1955</option><option value="1956">1956</option><option value="1957">1957</option><option value="1958">1958</option><option value="1959">1959</option><option value="1960">1960</option><option value="1961">1961</option><option value="1962">1962</option><option value="1963">1963</option><option value="1964">1964</option><option value="1965">1965</option><option value="1966">1966</option><option value="1967">1967</option><option value="1968">1968</option><option value="1969">1969</option><option value="1970">1970</option><option value="1971">1971</option><option value="1972">1972</option><option value="1973">1973</option><option value="1974">1974</option><option value="1975">1975</option><option value="1976">1976</option><option value="1977">1977</option><option value="1978">1978</option><option value="1979">1979</option><option value="1980">1980</option><option value="1981">1981</option><option value="1982">1982</option><option value="1983">1983</option><option value="1984">1984</option><option value="1985">1985</option><option value="1986">1986</option><option value="1987">1987</option><option value="1988">1988</option><option value="1989">1989</option><option value="1990">1990</option><option value="1991">1991</option><option value="1992">1992</option><option value="1993">1993</option><option value="1994">1994</option><option value="1995">1995</option><option value="1996">1996</option><option value="1997">1997</option><option value="1998">1998</option><option value="1999">1999</option><option value="2000">2000</option><option value="2001">2001</option><option value="2002">2002</option><option value="2003">2003</option><option value="2004">2004</option><option value="2005">2005</option><option value="2006">2006</option><option value="2007">2007</option><option value="2008">2008</option><option value="2009">2009</option><option value="2010">2010</option><option value="2011">2011</option><option value="2012">2012</option><option value="2013">2013</option><option value="2014">2014</option><option value="2015" selected="selected">2015</option><option value="2016">2016</option><option value="2017">2017</option><option value="2018">2018</option><option value="2019">2019</option><option value="2020">2020</option><option value="2021">2021</option><option value="2022">2022</option><option value="2023">2023</option><option value="2024">2024</option><option value="2025">2025</option><option value="2026">2026</option><option value="2027">2027</option><option value="2028">2028</option><option value="2029">2029</option><option value="2030">2030</option></select>年

<select size="1" name="ymonth" class="select">
<option value="1">1</option><option value="2">2</option><option value="3">3</option><option value="4">4</option><option value="5">5</option><option value="6">6</option><option value="7">7</option><option value="8">8</option><option value="9">9</option><option value="10">10</option><option value="11">11</option><option value="12">12</option></select>月

<select size="1" name="yday" class="select">
<option value="1">1</option><option value="2">2</option><option value="3">3</option><option value="4">4</option><option value="5">5</option><option value="6">6</option><option value="7">7</option><option value="8">8</option><option value="9">9</option><option value="10">10</option><option value="11">11</option><option value="12">12</option><option value="13">13</option><option value="14">14</option><option value="15">15</option><option value="16">16</option><option value="17">17</option><option value="18">18</option><option value="19">19</option><option value="20" selected="selected">20</option><option value="21">21</option><option value="22">22</option><option value="23">23</option><option value="24">24</option><option value="25">25</option><option value="26">26</option><option value="27">27</option><option value="28">28</option><option value="29">29</option><option value="30">30</option><option value="31">31</option></select> 日

<input onclick="CalConv(0)" class="button" type="button" value="阳历转阴历">

  

时间: 2024-10-05 05:07:15

阴阳历转换的相关文章

知识类API调用的代码示例合集:驾考题库、ISBN书号查询、万年历查询等

以下示例代码适用于 www.apishop.net 网站下的API,使用本文提及的接口调用代码示例前,您需要先申请相应的API服务. 驾考题库:获取驾考题目与答案 ISBN书号查询:通过10位或13位ISBN查询书号信息,包含书名.作者.出版社.价格.出版日期.印次.装帧方式.语种.摘要等信息. 万年历查询:查询指定日期的星期.星座.农历.生肖.天干地支.岁次.黄历相关的福神.喜神.宜忌等信息,还可以进行阴阳历转换. 节假日查询:全年节假日查询 成语大全:包含发音.解释.出自典故.近义词.反义词

WORD2010如何把全角字母和数字批量转换成半角

个人觉得全角字符看起来相当别扭,如果文档中存在大量全角形式的字母和数字,要如何把它们全部转化成半角的呢? 全角和半角 全角是指一个字符占用两个标准字符位置的状态.汉字字符和规定了全角的英文字符及国标GB2312-80中的图形符号和特殊字符都是全角字符. 半角的显示内码都是一个字节,英文字母.罗马数字.西方语言的符号都是半角形式. END 如何实现全角半角间的转换 全角字符占用更多字符,看起来也不够美观,如何将全角字符转换成半角的呢?这里我们可以利用word来实现.   不论是txt文档还是其他什

经济动能转换现万亿商机,腾讯云造人工智能数字商业

2017年6月,发改委印发<服务业创新发展大纲(2017-2025年)>(以下简称<大纲>),大纲指出我国正处于工业转型升级.新型城镇化推进和消费结构升级的大趋势中.预计到2025年,服务业增加值占GDP比重提高到60%. 根据国家统计局,2016年我国服务业增加值占GDP的比重达到51.6%.按2016年中国74万亿GDP估算,未来8年我国服务业增加值将有6.2万亿的增长空间.而数字经济和数字服务则是服务业增加值新增长的来源,对于企业来说则要把握历史机遇.加快推动数字商业创新发展

JSON与Javabean转换的几种形式

JSON格式的数据传递是最常用的方法之一,以下列出了常用的几种形态以及与Javabean之间的转换: String json1="{'name':'zhangsan','age':23,'interests':[{'interest':'篮球','colors':['绿色','黄色']},{'interest':'足球','colors':['红色','蓝色']}]}"; String json2="[{'name':'zhangsan'},{'name':'lisi'},{

myasql支持的数据类型以及函数转换

myasql支持的数据类型 1.数值类型 tinyint 1 小整数 smallint 2 大整数 mediumint 3 大整数 int 4 大整数 bigint 8 极大整数 如果插入 的较大较小 会自动改编为范围值 多余的数截取 float 4 double 8 decimal 默认是10 可以指定多少个整数和小数 2.字符串类型 char 0-255字节 定长字符串 varchar 0-255字节 变长字符串 tinyblob 0-255字节 不超过255个字符的二进制字符 tintex

zzuli oj 1134 字符串转换

题目链接: https://acm.zzuli.edu.cn/zzuliacm/problem.php?id=1134 Description 输入一个以回车结束的字符串,它由数字和字母组成,请过滤掉所有非数字字符,然后将数字字符串转换成十进制整数后乘以2输出. Input 输入一个以回车结束的字符串,长度不超过100,由数字和字母组成. Output 将转换后的整数乘以2输出,测试数据保证结果在int范围内. Sample Input sg987aa65t498 Sample Output 1

Date常用转换、比较

在项目开发过程中,遇到了一个需要把本年本月的充值超过1000元的用户都获取出来,但是我数据库时间存的是int类型.所以不知道where的条件语句怎么写,特此查了一下,再此总结一下,希望对需要的朋友能有所帮助. 总体思想是获取出来本月初和本月末的时间转化成int在where查询条件为之间的值. 引发出的问题:1) java获取当前系统时间 2)获取月初的月末的时间 3)时间格式转化成int 3. 时间转化用到的两个类 import java.util.Calendar; (日历) import j

关于raw_input输入中文时的编码转换

今日在敲代码时出现了如下问题 中文的编码出现了问题(在键盘输入中文时也会出现同样的问题),中文的编码应该是utf-8编码格式,有以下两种方式来进行编码转换: (1)decode用法:str  -> decode('the_coding_of_str') -> unicode 即写为格式:raw_input('净利润为:'.decode('utf-8').encode('gbk')) (2)encode用法:unicode -> encode('the_coding_you_want')

C#中图片.BYTE[]和base64string的转换

在C#中 图片到byte[]再到base64string的转换: Bitmap bmp = new Bitmap(filepath); MemoryStream ms = new MemoryStream(); bmp.Save(ms, System.Drawing.Imaging.ImageFormat.Gif); byte[] arr = new byte[ms.Length]; ms.Position = 0; ms.Read(arr, 0, (int)ms.Length); ms.Clo