public class LunarCodes extends Object
| 构造器和说明 |
|---|
LunarCodes() |
| 限定符和类型 | 方法和说明 |
|---|---|
static int |
codeDay(int code)
从代码中获取农历日在公历中的日 (day of month)
|
static int |
codeMonth(int code)
从代码中获取农历月初一在公历中的月份
|
static int |
codeYear(int code)
从代码中获取年份,大于12时表示下一年
|
static long |
lengthOfMonth(int lunarYear,
int month,
short code)
求一个农历月的天数
|
static short |
lunarMonthCode(int lunarYear,
int lunarMonth,
boolean isLeapMonth)
农历月的代码
|
static Map.Entry<Integer,Boolean> |
month(int year,
int index)
根据农历年和 LUNAR_INFO 中的下标来确定月份和闰月
|
static short[] |
monthCodes(int year)
农历年的代码数组
|
static int |
monthIndex(int year,
int month,
boolean isLeapMonth)
计算月份 Mdd 代码在数组中的位置
|
static long |
solarDateCodesDiff(int solarCode1,
int solarCode2,
int field)
判断两个整数所代表公历日期的差值
一年按365天计算,一个月按30天计算 |
public static short[] monthCodes(int year)
year - 农历年public static int codeYear(int code)
code - 代码public static int codeMonth(int code)
code - 代码public static int codeDay(int code)
code - 代码public static long lengthOfMonth(int lunarYear,
int month,
short code)
lunarYear - 农历年month - 农历月code - 农历月有日期,Mdd 表示public static Map.Entry<Integer,Boolean> month(int year, int index)
year - 农历年index - LUNAR_INFO 月份数组中的下标public static int monthIndex(int year,
int month,
boolean isLeapMonth)
year - 农历年month - 农历月isLeapMonth - 闰月public static long solarDateCodesDiff(int solarCode1,
int solarCode2,
int field)
solarCode1 - 农历日期代码solarCode2 - 农历日期代码field - 差值单位public static short lunarMonthCode(int lunarYear,
int lunarMonth,
boolean isLeapMonth)
lunarYear - 农历月lunarMonth - 农历月isLeapMonth - 闰月Copyright © 2021. All rights reserved.