public class SolarUtil extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
static int[] |
DAYS_OF_MONTH
每月天数
|
static Map<String,String> |
FESTIVAL
日期对应的节日
|
static Map<String,List<String>> |
OTHER_FESTIVAL
日期对应的非正式节日
|
static String[] |
WEEK
星期
|
static Map<String,String> |
WEEK_FESTIVAL
几月第几个星期几对应的节日
|
static String[] |
XINGZUO
星座
|
| 限定符 | 构造器和说明 |
|---|---|
protected |
SolarUtil() |
| 限定符和类型 | 方法和说明 |
|---|---|
static int |
getDaysBetween(int ay,
int am,
int ad,
int by,
int bm,
int bd)
获取两个日期之间相差的天数(如果日期a比日期b小,天数为正,如果日期a比日期b大,天数为负)
|
static int |
getDaysInYear(int year,
int month,
int day)
获取某天为当年的第几天
|
static int |
getDaysOfMonth(int year,
int month)
获取某年某月有多少天
|
static int |
getDaysOfYear(int year)
获取某年有多少天(平年365天,闰年366天)
|
static int |
getWeeksOfMonth(int year,
int month,
int start)
获取某年某月有多少周
|
static boolean |
isLeapYear(int year)
是否闰年
|
public static final String[] WEEK
public static final int[] DAYS_OF_MONTH
public static final String[] XINGZUO
public static boolean isLeapYear(int year)
year - 年public static int getDaysOfYear(int year)
year - 年public static int getDaysOfMonth(int year,
int month)
year - 年month - 月public static int getDaysInYear(int year,
int month,
int day)
year - 年month - 月day - 日public static int getWeeksOfMonth(int year,
int month,
int start)
year - 年month - 月start - 星期几作为一周的开始,1234560分别代表星期一至星期天public static int getDaysBetween(int ay,
int am,
int ad,
int by,
int bm,
int bd)
ay - 年aam - 月aad - 日aby - 年bbm - 月bbd - 日bCopyright © 2023. All Rights Reserved.