public class DateKit extends Almanac
| Constructor and Description |
|---|
DateKit() |
| Modifier and Type | Method and Description |
|---|---|
static int |
ageOfNow(Date birthDay)
生日转为年龄,计算法定年龄
|
static int |
ageOfNow(String birthDay)
生日转为年龄,计算法定年龄
|
static String |
getLastTime(Date date)
返回文字描述的日期
|
Lunar |
getLunar()
通过公历构造
|
Lunar |
getLunar(Calendar calendar)
通过公历构造
|
Lunar |
getLunar(int year,
int month,
int day)
通过年、月、日构造
|
Lunar |
getLunar(int year,
int month,
int day,
int hour,
int minute)
通过年、月、日构造
|
Lunar |
getLunar(int year,
int month,
int day,
int hour,
int minute,
int second)
通过年、月、日构造
|
Solar |
getSolar()
通过公历构造
|
Solar |
getSolar(Calendar calendar)
通过公历构造
|
Solar |
getSolar(int year,
int month,
int day)
通过年、月、日构造
|
Solar |
getSolar(int year,
int month,
int day,
int hour,
int minute)
通过年、月、日构造
|
Solar |
getSolar(int year,
int month,
int day,
int hour,
int minute,
int second)
通过年、月、日构造
|
static Boundary |
range(Date start,
Date end,
Fields.Type type)
创建日期范围生成器
|
static List<DateTime> |
rangeToList(Date start,
Date end,
Fields.Type type)
创建日期范围生成器
|
static long |
spendMs(long preTime)
计时,常用于记录某段代码的执行时间,单位:毫秒
|
static long |
spendNt(long preTime)
计时,常用于记录某段代码的执行时间,单位:纳秒
|
beginOfDay, beginOfDay, beginOfHour, beginOfHour, beginOfMinute, beginOfMinute, beginOfMonth, beginOfMonth, beginOfQuarter, beginOfQuarter, beginOfSecond, beginOfSecond, beginOfWeek, beginOfWeek, beginOfWeek, beginOfYear, beginOfYear, between, between, betweenDay, betweenDays, betweenDays, betweenDays, betweenMonth, betweenMonths, betweenMonths, betweenMonths, betweenMs, betweenNextSameMonthDay, betweenNextSameMonthDay, betweenNextSameMonthDay, betweenNextSameMonthDayOfNow, betweenTotalDays, betweenTotalDays, betweenTotalHours, betweenTotalHours, betweenTotalHours, betweenTotalMillis, betweenTotalMillis, betweenTotalMillis, betweenTotalMinutes, betweenTotalMinutes, betweenTotalMinutes, betweenTotalNanos, betweenTotalNanos, betweenTotalNanos, betweenTotalSeconds, betweenTotalSeconds, betweenTotalSeconds, betweenYear, betweenYears, betweenYears, betweenYears, ceiling, ceiling, ceiling, ceiling, compare, compare, compare, compare, compare, date, date, date, date, date, durationBetween, endAccuracyTimeOfDate, endAccuracyTimeOfDay, endAccuracyTimeOfLocalDateTime, endOfDay, endOfDay, endOfHour, endOfHour, endOfMinute, endOfMinute, endOfMonth, endOfMonth, endOfQuarter, endOfQuarter, endOfSecond, endOfSecond, endOfWeek, endOfWeek, endOfWeek, endOfYear, endOfYear, endTimeOfCurrentQuarter, endTimeOfCurrentYear, endTimeOfDate, endTimeOfDate, endTimeOfDay, endTimeOfFirstQuarter, endTimeOfFourthQuarter, endTimeOfLastMonth, endTimeOfMonth, endTimeOfSecondQuarter, endTimeOfSpecialMonth, endTimeOfThirdQuarter, endTimeOfToday, endTimeOfTomorrow, endTimeOfYear, endTimeOfYesterday, firstDayOfMonth, firstDayOfMonth, firstDayOfMonth, formatBetween, formatBetween, formatBetween, formatBetween, getAge, getAge, getAge, getAge, getAge, getAge, getAge, getAge, getAnimal, getAnimal, getAnimal, getBeginValue, getChrono, getChrono, getChrono, getChrono, getDate, getDate, getDate, getDateEndOfMonth, getDateList, getDateList, getDateList, getDateStartOfMonth, getDayOfMonth, getDayOfMonth, getDayOfMonth, getDayOfMonth, getDayOfMonth, getDayOfMonth, getDayOfWeek, getDayOfWeek, getDayOfWeek, getDayOfWeek, getDayOfWeekCn, getDayOfWeekCn, getDayOfWeekCn, getDayOfWeekCn, getDayOfWeekCnShort, getDayOfWeekCnShort, getDayOfWeekCnShort, getDayOfWeekCnShort, getDayOfWeekEnLong, getDayOfWeekEnLong, getDayOfWeekEnLong, getDayOfWeekEnLong, getDayOfWeekEnShort, getDayOfWeekEnShort, getDayOfWeekEnShort, getDayOfWeekEnShort, getDayOfWeekEnShortUpper, getDayOfWeekEnShortUpper, getDayOfWeekEnShortUpper, getDayOfWeekEnShortUpper, getDayOfYear, getDayOfYear, getDayOfYear, getDayOfYear, getDayOfYear, getEndValue, getEpochMilli, getEpochMilliFormat, getEpochMilliFormatFull, getEpochMilliIsoFormatFullNoColon, getEpochMilliIsoNotFormatNoColon, getEpochSecond, getHour, getHour, getHour, getHour, getInterval, getLast, getLast, getLast, getLast, getLengthOfYear, getLocalDateList, getLocalDateList, getLocalDateList, getLocalDateList, getLocalDateTimeList, getLocalDateTimeList, getLocalDateTimeList, getLocalDateTimeList, getMillisecond, getMillisecond, getMillisecond, getMillisecond, getMillisecond, getMinute, getMinute, getMinute, getMinute, getMonth, getMonth, getMonth, getMonth, getMonth, getMonth, getMonth, getMonthCnLong, getMonthCnLong, getMonthCnLong, getMonthCnLong, getMonthCnShort, getMonthCnShort, getMonthCnShort, getMonthCnShort, getMonthEnLong, getMonthEnLong, getMonthEnLong, getMonthEnLong, getMonthEnShort, getMonthEnShort, getMonthEnShort, getMonthEnShort, getMonthEnShortUpper, getMonthEnShortUpper, getMonthEnShortUpper, getMonthEnShortUpper, getMonthOfQuarter, getMonthOfQuarter, getQuarter, getQuarter, getQuarter, getQuarter, getQuarter, getQuarter, getQuarter, getQuarter, getQuarterOfMonth, getSecond, getSecond, getSecond, getSecond, getWeek, getWeek, getWeek, getWeeks, getYear, getYear, getYear, getYear, getYear, getYear, getZodiac, getZodiac, getZodiac, getZodiacCnName, getZodiacCnName, getZodiacEnName, getZodiacEnName, getZonedDateTimeNow, getZonedDateTimeNowOfCTT, getZonedDateTimeNowOfDefault, getZonedDateTimeNowOfECT, getZonedDateTimeNowOfEST, getZonedDateTimeNowOfJST, isAM, isAM, isBefore, isBefore, isBirthDay, isBirthDay, isBirthDay, isDate, isDate, isDatetime, isExpiry, isExpiry, isFriday, isFriday, isIn, isLeapYear, isLeapYear, isLeapYear, isLeapYear, isMonday, isMonday, isNotLessThanToday, isNotLessThanToday, isPM, isPM, isSameDay, isSameMonth, isSameMonthDay, isSameMonthDay, isSameMonthDay, isSameMonthDay, isSameMonthDay, isSameMonthDayOfNow, isSameTime, isSameTime, isShortDate, isWeekend, isWeekend, isWeekend, isWorkDay, isWorkDay, isWorkDay, lastDayOfMonth, lastDayOfMonth, lastDayOfMonth, lastMonth, lastWeek, lastYear, lengthOfMonth, lengthOfMonth, lengthOfMonth, lengthOfYear, lengthOfYear, lengthOfYear, next, next, next, nextLeapYear, nextLeapYear, nextLeapYear, nextLeapYear, nextMonth, nextSameMonthDay, nextSameMonthDay, nextSameMonthDayOfNow, nextWeek, nextWorkDay, nextWorkDay, nextWorkDay, nextWorkDay, nextYear, offset, offsetDay, offsetHour, offsetMillisecond, offsetMinute, offsetMonth, offsetSecond, offsetWeek, offsetYear, periodBetween, previous, previous, previous, reduceAccuracyToDay, reduceAccuracyToDay, reduceAccuracyToHour, reduceAccuracyToHour, reduceAccuracyToMinute, reduceAccuracyToMinute, reduceAccuracyToSecond, reduceAccuracyToSecond, round, round, startTimeOfCurrentQuarter, startTimeOfCurrentYear, startTimeOfDate, startTimeOfDate, startTimeOfDay, startTimeOfFirstQuarter, startTimeOfFourthQuarter, startTimeOfLastMonth, startTimeOfLocalDateTime, startTimeOfMonth, startTimeOfSecondQuarter, startTimeOfSpecialMonth, startTimeOfThirdQuarter, startTimeOfToday, startTimeOfTomorrow, startTimeOfYear, startTimeOfYesterday, thisMonth, thisWeek, thisYear, timestamp, timestamp, today, tomorrow, transform, transform, transform, transform, truncate, truncate, weekOfMonth, weekOfMonth, weekOfMonth, weekOfMonth, weekOfMonth, weekOfYear, weekOfYear, weekOfYear, weekOfYear, weekOfYear, with, with, withDayOfMonth, withDayOfMonth, withDayOfMonth, withDayOfWeek, withDayOfWeek, withDayOfWeek, withDayOfYear, withDayOfYear, withDayOfYear, withHour, withHour, withHour, withMilli, withMilli, withMilli, withMinute, withMinute, withMinute, withMonth, withMonth, withMonth, withSecond, withSecond, withSecond, withYear, withYear, withYear, yesterdaytoCalendar, toCalendar, toCalendar, toDate, toDate, toDate, toDate, toDate, toDate, toDate, toDateEndOfMonth, toDateStartOfMonth, toEpochMilli, toEpochMilli, toEpochMilli, toEpochMilli, toEpochMilli, toEpochMilli, toInstant, toInstant, toInstant, toInstant, toInstant, toInstant, toInstant, toInstant, toInstant, toLocalDate, toLocalDate, toLocalDate, toLocalDate, toLocalDate, toLocalDate, toLocalDate, toLocalDateEndOfMonth, toLocalDateStartOfMonth, toLocalDateTime, toLocalDateTime, toLocalDateTime, toLocalDateTime, toLocalDateTime, toLocalDateTime, toLocalDateTime, toLocalDateTime, toLocalTime, toLocalTime, toLocalTime, toLocalTime, toLocalTime, toSecond, toTime, toTimestamp, toTimestamp, toTimestamp, toTimestamp, toYearMonth, toYearMonth, toYearMonth, toYearMonth, toYearMonth, toZonedDateTime, toZonedDateTime, toZonedDateTime, toZonedDateTime, toZonedDateTime, toZonedDateTime, toZonedDateTime, toZonedDateTime, toZonedDateTime, toZonedDateTimeformat, format, format, format, format, format, format, format, format, format, format, format, format, format, format, format, formatDate, formatDate, formatTime, newSimpleFormat, newSimpleFormat, parse, parse, parse, parse, parse, parse, parse, parse, parse, parse, parseByPatterns, parseByPatterns, parseByPatterns, parseCST, parseDate, parseDateTime, parseTime, parseTimeToday, parseUTC, toIntSecondpublic static long spendNt(long preTime)
preTime - 之前记录的时间public static long spendMs(long preTime)
preTime - 之前记录的时间public static int ageOfNow(String birthDay)
birthDay - 生日,标准日期字符串public static int ageOfNow(Date birthDay)
birthDay - 生日public static Boundary range(Date start, Date end, Fields.Type type)
start - 起始日期时间end - 结束日期时间type - 步进单位Boundarypublic static List<DateTime> rangeToList(Date start, Date end, Fields.Type type)
start - 起始日期时间end - 结束日期时间type - 步进单位Boundarypublic Lunar getLunar(int year, int month, int day)
year - 农历年month - 农历月份,范围1-12day - 农历日1-30Lunarpublic Lunar getLunar(int year, int month, int day, int hour, int minute)
year - 农历年month - 农历月份,范围1-12day - 农历日1-30hour - 小时minute - 分钟Lunarpublic Lunar getLunar(int year, int month, int day, int hour, int minute, int second)
year - 农历年month - 农历月份,范围1-12day - 农历日1-30hour - 小时minute - 分钟second - 秒Lunarpublic Solar getSolar(int year, int month, int day)
year - 农历年month - 农历月份,范围1-12day - 农历日1-30Solarpublic Solar getSolar(int year, int month, int day, int hour, int minute)
year - 农历年month - 农历月份,范围1-12day - 农历日1-30hour - 小时minute - 分钟SolarCopyright © 2021. All rights reserved.