Package org.aoju.bus.core.toolkit
Class DateKit
java.lang.Object
org.aoju.bus.core.date.Formatter
org.aoju.bus.core.date.Converter
org.aoju.bus.core.date.Almanac
org.aoju.bus.core.toolkit.DateKit
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic int生日转为年龄,计算法定年龄static int生日转为年龄,计算法定年龄static StringgetLastTime(Date date) 返回文字描述的日期getLunar()通过公历构造getLunar(int year, int month, int day) 通过年、月、日构造getLunar(int year, int month, int day, int hour, int minute) 通过年、月、日构造getLunar(int year, int month, int day, int hour, int minute, int second) 通过年、月、日构造通过公历构造getSolar()通过公历构造getSolar(int year, int month, int day) 通过年、月、日构造getSolar(int year, int month, int day, int hour, int minute) 通过年、月、日构造getSolar(int year, int month, int day, int hour, int minute, int second) 通过年、月、日构造通过公历构造static Boundaryrange(Date start, Date end, Fields.Type type) 创建日期范围生成器static voidrangeConsume(Date start, Date end, Fields.Type type, Consumer<Date> consumer) 按日期范围遍历,执行 consumerrangeContains(Boundary start, Boundary end) 两个时间区间取交集static <T> List<T> 按日期范围遍历,执行 functionrangeNotContains(Boundary start, Boundary end) 两个时间区间取差集(end - start)rangeToList(Date start, Date end, Fields.Type type) 根据步进单位获取起始日期时间和结束日期时间的时间区间集合rangeToList(Date start, Date end, Fields.Type type, int step) 根据步进单位和步进获取起始日期时间和结束日期时间的时间区间集合static longspendMs(long preTime) 计时,常用于记录某段代码的执行时间,单位:毫秒static longspendNt(long preTime) 计时,常用于记录某段代码的执行时间,单位:纳秒Methods inherited from class org.aoju.bus.core.date.Almanac
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, 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, getLastDayOfMonth, 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, getZodiac, getZodiac, getZodiac, getZodiacCnName, getZodiacCnName, getZodiacEnName, getZodiacEnName, getZonedDateTimeNow, getZonedDateTimeNowOfCTT, getZonedDateTimeNowOfDefault, getZonedDateTimeNowOfECT, getZonedDateTimeNowOfEST, getZonedDateTimeNowOfJST, isAM, isAM, isBefore, isBefore, isBirthday, isBirthday, isBirthDay, isBirthDay, isBirthDay, isDate, isDate, isDatetime, isExpiry, isExpiry, isFriday, isFriday, isIn, isIn, isIn, isIn, isIn, isLastDayOfMonth, isLeapYear, isLeapYear, isLeapYear, isLeapYear, isMonday, isMonday, isNotLessThanToday, isNotLessThanToday, isOverlap, isPM, isPM, isSameDay, isSameDay, isSameDay, isSameDay, isSameMonth, isSameMonth, isSameMonthDay, isSameMonthDay, isSameMonthDay, isSameMonthDay, isSameMonthDay, isSameMonthDayOfNow, isSameTime, isSameTime, isSameWeek, isSameWeek, 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, now, 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, withDay, withDayOfMonth, withDayOfMonth, withDayOfMonth, withDayOfWeek, withDayOfWeek, withDayOfWeek, withDayOfYear, withDayOfYear, withDayOfYear, withHour, withHour, withHour, withHour, withMilli, withMilli, withMilli, withMilli, withMinute, withMinute, withMinute, withMinute, withMonth, withMonth, withMonth, withSecond, withSecond, withSecond, withSecond, withWeek, withYear, withYear, withYear, withYear, yesterdayMethods inherited from class org.aoju.bus.core.date.Converter
toCalendar, toCalendar, toCalendar, toCalendar, toDate, toDate, toDate, toDate, toDate, toDate, toDate, toDateEndOfMonth, toDateStartOfMonth, toEpochMilli, 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, toTimeZone, toTimeZone, toYearMonth, toYearMonth, toYearMonth, toYearMonth, toYearMonth, toZonedDateTime, toZonedDateTime, toZonedDateTime, toZonedDateTime, toZonedDateTime, toZonedDateTime, toZonedDateTime, toZonedDateTime, toZonedDateTime, toZonedDateTimeMethods inherited from class org.aoju.bus.core.date.Formatter
format, format, format, format, format, format, format, format, format, format, format, format, format, format, format, format, format, formatBetween, formatBetween, formatBetween, formatBetween, formatDate, formatDate, formatTime, getShotName, newSimpleFormat, newSimpleFormat, parse, parse, parse, parse, parse, parse, parse, parse, parseByPatterns, parseByPatterns, parseByPatterns, parseByPatterns
-
Constructor Details
-
DateKit
public DateKit()
-
-
Method Details
-
spendNt
public static long spendNt(long preTime) 计时,常用于记录某段代码的执行时间,单位:纳秒- Parameters:
preTime- 之前记录的时间- Returns:
- 时间差, 纳秒
-
spendMs
public static long spendMs(long preTime) 计时,常用于记录某段代码的执行时间,单位:毫秒- Parameters:
preTime- 之前记录的时间- Returns:
- 时间差, 毫秒
-
ageOfNow
生日转为年龄,计算法定年龄- Parameters:
birthDay- 生日,标准日期字符串- Returns:
- 年龄
-
ageOfNow
-
getLastTime
-
range
创建日期范围生成器- Parameters:
start- 起始日期时间end- 结束日期时间type- 步进单位- Returns:
Boundary
-
rangeContains
-
rangeNotContains
-
rangeFunc
-
rangeConsume
按日期范围遍历,执行 consumer- Parameters:
start- 起始日期时间(包括)end- 结束日期时间type- 步进单位consumer- 每次遍历要执行的 consumer
-
rangeToList
-
rangeToList
-
getLunar
-
getLunar
-
getLunar
-
getLunar
-
getLunar
-
getSolar
-
getSolar
-
getSolar
-
getSolar
-
getSolar
-