数据处理
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
package com.cool.store.utils;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
|
||||
import java.text.DateFormat;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
@@ -39,6 +41,21 @@ public class CoolDateUtils {
|
||||
return now.getTime();
|
||||
}
|
||||
|
||||
/**
|
||||
* n天后 的最小时间 20230613 2天后最小时间---->2023-06-15 00:00:00
|
||||
* @param day
|
||||
* @return
|
||||
*/
|
||||
public static Date getDateFormatDayMinTime(int day){
|
||||
LocalDate today = LocalDate.now();
|
||||
LocalDate thirdDay = today.plusDays(day);
|
||||
LocalDateTime thirdDayMidnight = LocalDateTime.of(thirdDay, LocalTime.MIDNIGHT);
|
||||
LocalDateTime thirdDay235959 = thirdDayMidnight.with(LocalTime.MIN);
|
||||
ZonedDateTime zonedDateTime = ZonedDateTime.of(thirdDay235959, ZoneId.systemDefault());
|
||||
return Date.from(zonedDateTime.toInstant());
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* n天后 的最大时间 20230613 2天后最大时间---->2023-06-15 23:59:59
|
||||
|
||||
Reference in New Issue
Block a user