- java.lang.Object
-
- develop.toolkit.base.utils.DateTimeAdvice
-
public final class DateTimeAdvice extends Object
日期时间增强工具- 作者:
- qiushui on 2019-02-20.
-
-
构造器概要
构造器 构造器 说明 DateTimeAdvice()
-
方法概要
所有方法 静态方法 具体方法 修饰符和类型 方法 说明 static Stringformat(LocalDateTime localDateTime)格式化LocalDateTimestatic Stringformat(LocalDateTime localDateTime, String pattern)格式化LocalDateTimestatic Stringformat(Date date)格式化Datestatic Stringformat(Date date, String pattern)格式化Datestatic DatefromInstant(Instant instant)从Instant转到Datestatic DatefromLocalDate(LocalDate localDate)从LocalDate转到Datestatic DatefromLocalDateTime(LocalDateTime localDateTime)从LocalDateTime转到Datestatic DatefromLocalTime(LocalTime localTime)从LocalTime转到Datestatic booleanisSameMonth(LocalDate day1, LocalDate day2)判断是否同一个月static StringmillisecondPretty(long millisecond)毫秒美化static Stringnow()static InstanttoInstant(Date date)Date转到Instantstatic LocalDatetoLocalDate(Date date)Date转到LocalDatestatic LocalDateTimetoLocalDateTime(Date date)Date转到LocalDateTimestatic LocalTimetoLocalTime(Date date)Date转到LocalTime
-
-
-
方法详细资料
-
now
public static String now()
-
format
public static String format(LocalDateTime localDateTime)
格式化LocalDateTime- 参数:
localDateTime-- 返回:
-
format
public static String format(LocalDateTime localDateTime, String pattern)
格式化LocalDateTime- 参数:
localDateTime-pattern-- 返回:
-
toLocalDateTime
public static LocalDateTime toLocalDateTime(Date date)
Date转到LocalDateTime- 参数:
date-- 返回:
-
fromLocalDateTime
public static Date fromLocalDateTime(LocalDateTime localDateTime)
从LocalDateTime转到Date- 参数:
localDateTime-- 返回:
-
fromLocalDate
public static Date fromLocalDate(LocalDate localDate)
从LocalDate转到Date- 参数:
localDate-- 返回:
-
fromLocalTime
public static Date fromLocalTime(LocalTime localTime)
从LocalTime转到Date- 参数:
localTime-- 返回:
-
isSameMonth
public static boolean isSameMonth(LocalDate day1, LocalDate day2)
判断是否同一个月- 参数:
day1-day2-- 返回:
-
millisecondPretty
public static String millisecondPretty(long millisecond)
毫秒美化- 参数:
millisecond-- 返回:
-
-