java万年历阴阳历转换

来源:百度知道 编辑:UC知道 时间:2024/05/17 00:02:42
有谁懂的?
我已经有一段代码了,还需要添加一段阳历转化为阴历的,谁可以帮我下

package test;

public class TestNongLi {
public static void main(String[] args) {
// 调用农历日期转换阳历日期方法
System.out.println(ChineseCalendar.sCalendarLundarToSolar(2008, 1, 1));
}
}

// 自定义日历类
class ChineseCalendar {

// Array lIntLunarDay is stored in the monthly day information in every year from 1901 to 2100 of the lunar calendar,
// The lunar calendar can only be 29 or 30 days every month, express with 12(or 13) pieces of binary bit in one year,
// it is 30 days for 1 form in the corresponding location , otherwise it is 29 days
private static final int[] iLunarMonthDaysTable = { 0x4ae0, 0xa570, 0x5268, 0xd260, 0xd950, 0x6aa8, 0x56a0, 0x9ad0, 0x4ae8,
0x4ae0, // 1910
0xa4d8, 0xa4d0, 0xd250, 0xd548, 0xb550, 0x56a0, 0x96d0, 0x95b0, 0x49b8, 0x49b0, // 1920
0xa4b0, 0xb258, 0x6a50, 0x6d40, 0xada8, 0x2b60, 0x9570, 0x4978, 0x4970, 0x64b0, // 1930
0xd4a0, 0xea50, 0x6d48