public final class LunarDate extends Object implements Temporal, Serializable
| 限定符和类型 | 字段和说明 |
|---|---|
static String[] |
lunarMonth
农历月份列表
|
static String[] |
numStr
中文数字0-9
|
static String[] |
solarTerms
二十四节气
|
| 限定符和类型 | 方法和说明 |
|---|---|
static String |
animalsYear(int year)
传回农历 year年的生肖
|
static long[] |
calElement(int year,
int month,
int day)
传出year年month月day日对应的农历.year0 .month1 .day2 .yearCyl3 .monCyl4 .dayCyl5
.isLeap6.solarTermIndex7
|
static String |
cyclical(int year)
传入 offset 传回干支, 0=甲子
|
String |
formatLongCn()
格式化输出,如: 己亥猪年 二〇一九年腊月初六 星期二
|
String |
formatLongCnWithChineseHoliday()
格式化输出,如:庚子鼠年 二〇二〇年正月初一 星期六 春节
|
String |
formatShort()
格式化输出,如: 0101
|
static LunarDate |
from(Date date)
通过Date创建LunarDate
|
static LunarDate |
from(Instant instant)
通过Instant创建LunarDate
|
static LunarDate |
from(LocalDate localDate)
通过LocalDate创建LunarDate
|
static LunarDate |
from(LocalDateTime localDateTime)
通过LocalDateTime创建LunarDate
|
static LunarDate |
from(Temporal temporal) |
static String |
getChinaDay(int day)
获取农历中文日期
|
static String |
getChinaYear(int year)
获取农历中文年
|
Date |
getDate() |
String |
getgDate() |
int |
getgDay() |
int |
getgMonth() |
int |
getgYear() |
String |
getlAnimal() |
String |
getlDate() |
String |
getlDateCn() |
int |
getlDay() |
String |
getlDayCn() |
String |
getLeapMonthCn() |
int |
getlMonth() |
String |
getlMonthCn() |
LocalDate |
getLocalDate() |
long |
getLong(TemporalField field) |
int |
getlYear() |
String |
getlYearCn() |
String |
getSolarTerm() |
String |
getSuiCi() |
String |
getWeekCn() |
static String |
getWeekCn(int week)
获取中文星期
|
void |
initialize()
初始化农历日期
|
boolean |
isSupported(TemporalField field) |
boolean |
isSupported(TemporalUnit unit) |
static Date |
lunarToSolar(int lYear,
int lMonth,
int lDay,
boolean isLeapMonth)
农历转公历日期
|
static LunarDate |
now()
以当前时间创建农历日期LunarDate
|
static LunarDate |
of(int lYear,
int lMonth,
int lDay)
根据农历年月日生成农历日期
|
static LunarDate |
of(int lYear,
int lMonth,
int lDay,
boolean isLeapMonth)
根据农历年月日生成农历日期
|
Temporal |
plus(long amountToAdd,
TemporalUnit unit) |
void |
setDate(Date date) |
void |
setgDate(String gDate) |
void |
setgDay(int gDay) |
void |
setgMonth(int gMonth) |
void |
setgYear(int gYear) |
void |
setlDate(String lDate) |
static int |
solarTerm(int year,
int n)
计算某年第n个节气的天
|
static Date |
solarTermToDate(int year,
int index)
二十节气转公历日期
|
String |
toString() |
long |
until(Temporal endExclusive,
TemporalUnit unit) |
Temporal |
with(TemporalField field,
long newValue) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitget, query, rangepublic static final String[] lunarMonth
public static final String[] numStr
public static final String[] solarTerms
public void initialize()
public static LunarDate from(LocalDateTime localDateTime)
localDateTime - LocalDateTimepublic static LunarDate from(LocalDate localDate)
localDate - LocalDatepublic static LunarDate from(Instant instant)
instant - Instantpublic static LunarDate of(int lYear, int lMonth, int lDay)
lYear - 农历年lMonth - 农历月lDay - 农历日public static LunarDate of(int lYear, int lMonth, int lDay, boolean isLeapMonth)
lYear - 农历年lMonth - 农历月lDay - 农历日isLeapMonth - 是否是农历闰月public static Date lunarToSolar(int lYear, int lMonth, int lDay, boolean isLeapMonth)
lYear - 农历年lMonth - 农历月lDay - 农历日isLeapMonth - 是否是农历闰月public static Date solarTermToDate(int year, int index)
year - 公历年index - 第一个节气,小寒 为第一个public static final String animalsYear(int year)
year - 年public static final String cyclical(int year)
year - 年public static final int solarTerm(int year,
int n)
year - 公历年n - 第n个节气public static final long[] calElement(int year,
int month,
int day)
year - 年month - 月day - 日public static final String getChinaYear(int year)
year - 年public static final String getChinaDay(int day)
day - 日public static final String getWeekCn(int week)
week - 星期public static LunarDate now()
public LocalDate getLocalDate()
public String getlDateCn()
public String getSuiCi()
public String getlAnimal()
public int getlYear()
public int getlMonth()
public int getlDay()
public String getlYearCn()
public String getlMonthCn()
public String getlDayCn()
public String getWeekCn()
public String getSolarTerm()
public String getLeapMonthCn()
public String getlDate()
public void setlDate(String lDate)
public String getgDate()
public void setgDate(String gDate)
public int getgYear()
public void setgYear(int gYear)
public int getgMonth()
public void setgMonth(int gMonth)
public int getgDay()
public void setgDay(int gDay)
public Date getDate()
public void setDate(Date date)
public String formatLongCnWithChineseHoliday()
public String formatLongCn()
public String formatShort()
public boolean isSupported(TemporalField field)
isSupported 在接口中 TemporalAccessorpublic long getLong(TemporalField field)
getLong 在接口中 TemporalAccessorpublic boolean isSupported(TemporalUnit unit)
isSupported 在接口中 Temporalpublic Temporal with(TemporalField field, long newValue)
public Temporal plus(long amountToAdd, TemporalUnit unit)
public long until(Temporal endExclusive, TemporalUnit unit)
Copyright © 2021. All rights reserved.