怎么在jsp页面上得到当天的阴历日期

来源:百度知道 编辑:UC知道 时间:2024/06/04 18:17:02

这个没有现成的api可以调用,给你个java的阴历算法,可以在后台做成一个servlet,供你的jsp调用。

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

public class Lunar {
private int year;
private int month;
private int day;
private boolean leap;
final static String chineseNumber[] = {"正", "二", "三", "四", "五", "六", "七", "八", "九", "十", "十一", "腊"};
final static String chineseNumber1[] = {"一", "二", "三", "四", "五", "六", "七", "八", "九", "十", "十一", "十二"};
static SimpleDateFormat chineseDateFormat = new SimpleDateFormat("yyyy年MM月dd日");
final static long[] lunarInfo = new long[]
{0x04bd8, 0x04ae0, 0x0a570, 0x0