background image

 
45, 35, 24, 43, 32, 20, 39, 29, 47, 36, // 1970 
      26, 45, 33, 22, 41, 30, 48, 37, 27, 46, // 1980 
      35, 24, 43, 32, 50, 39, 28, 47, 36, 26, // 1990 
      45, 34, 22, 40, 30, 49, 37, 27, 46, 35, // 2000 
      23, 42, 31, 21, 39, 28, 48, 37, 25, 44, // 2010 
      33, 23, 41, 31, 50, 39, 28, 47, 35, 24, // 2020 
      42, 30, 21, 40, 28, 47, 36, 25, 43, 33, // 2030 
      22, 41, 30, 49, 37, 26, 44, 33, 23, 42, // 2040 
      31, 21, 40, 29, 47, 36, 25, 44, 32, 22, // 2050 
  };
static boolean bIsSolarLeapYear(int iYear) {
return ((iYear % 4 == 0) && (iYear % 100 != 0) || iYear % 400 == 0);
}
// The days in the month of solar calendar 
  static int iGetSYearMonthDays(int iYear, int iMonth) {
if ((iMonth == 1) || (iMonth == 3) || (iMonth == 5) || (iMonth == 7) || (iMonth 
== 8)      

|| (iMonth == 10) || (iMonth == 12))
return 31;
else if ((iMonth == 4) || (iMonth == 6) || (iMonth == 9) || (iMonth == 11))
return 30;
else if (iMonth == 2) {
if (bIsSolarLeapYear(iYear))
return 29;
else
return 28;
} else
return 0;
}
// The offset days from New Year and the day when point out in solar calendar 
  static int iGetSNewYearOffsetDays(int iYear, int iMonth, int iDay) {
int iOffsetDays = 0;
for (int i = 1; i < iMonth; i++) {
iOffsetDays += iGetSYearMonthDays(iYear, i);
}
iOffsetDays += iDay - 1;
return iOffsetDays;
}
static int iGetLLeapMonth(int iYear) {
char iMonth = iLunarLeapMonthTable[(iYear - 1901) / 2];
if (iYear % 2 == 0)