@Component public class LocalDateTimeUtil extends Object
| 限定符和类型 | 类和说明 |
|---|---|
static class |
LocalDateTimeUtil.DateDays
TODO 获取日期端的数据保存对象
|
| 构造器和说明 |
|---|
LocalDateTimeUtil() |
public static LocalDateTimeUtil getInstance()
public static LocalDateTime now()
public static int week(LocalDateTime time)
public static LocalDateTime monthFirst(int num)
public static LocalDateTime monthLast(int num)
public static LocalDateTime weekFirst(int num)
public static LocalDateTime weekLast(int num)
public static LocalDateTime plusDays(int num)
public static boolean isBefore(LocalDateTime t1, LocalDateTime t2)
public static boolean isAfter(LocalDateTime t1, LocalDateTime t2)
public static LocalDateTime of(int year, int month, int dayOfMonth, int hour, int minute)
public static LocalDateTime of(int year, int month, int dayOfMonth, int hour, int minute, int second, int nanoOfSecond)
public static LocalDateTime convertDateToLDT(Date date)
public static Date convertLDTToDate(LocalDateTime time)
public static Long getMilliByTime(LocalDateTime time)
public static Long getSecondsByTime(LocalDateTime time)
public static String formatTime(LocalDateTime time, String pattern)
public static LocalDateTime formatTime(String time, String pattern)
time - pattern - public LocalDate formatDate(String time, String pattern)
time - pattern - public static LocalDateTime plus(LocalDateTime time, long number, TemporalUnit field)
public static LocalDate plus(LocalDate time, long number, TemporalUnit field)
public static LocalDateTime subtract(LocalDateTime time, long number, TemporalUnit field)
public static long betweenTwoTime(LocalDateTime startTime, LocalDateTime endTime, ChronoUnit field)
startTime - endTime - field - 单位(年月日时分秒)public static LocalDateTime getDayStart(LocalDateTime time)
public static LocalDateTime getDayEnd(LocalDateTime time)
public static LocalDateTime getWeekOfFirst(LocalDateTime time)
public static LocalDateTime getWeekOfLast(LocalDateTime time)
public static LocalDateTime getMonthOfFirst(LocalDateTime time)
public static LocalDateTime getMonthOfLast(LocalDateTime time)
public static List<LocalDateTimeUtil.DateDays> getDateDaysUpList(Integer num)
public static int getDaysOfMonth(int num)
num - public int getTenDay(LocalDate localDate)
localDate - public int getFDay(LocalDate localDate)
localDate - public String getDataFormatePath(String path, LocalDate dt)
path - public String getDataFormate(String sourceFileDate, LocalDate dt)
sourceFileDate - public String appendZero(int obj)
public static void main(String[] args)
Copyright © 2022. All rights reserved.