idCard
This commit is contained in:
@@ -46,8 +46,8 @@ public class CoolDateUtils {
|
||||
* @param day
|
||||
* @return
|
||||
*/
|
||||
public static Date getDateFormatDayMinTime(int day){
|
||||
LocalDate today = LocalDate.now();
|
||||
public static Date getDateFormatDayMinTime(Date date,int day){
|
||||
LocalDate today = date.toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
|
||||
LocalDate thirdDay = today.plusDays(day);
|
||||
LocalDateTime thirdDayMidnight = LocalDateTime.of(thirdDay, LocalTime.MIDNIGHT);
|
||||
LocalDateTime thirdDay235959 = thirdDayMidnight.with(LocalTime.MIN);
|
||||
@@ -55,6 +55,16 @@ public class CoolDateUtils {
|
||||
return Date.from(zonedDateTime.toInstant());
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
// 创建一个Date对象
|
||||
Date date = new Date();
|
||||
|
||||
// 将Date对象转换为LocalDate对象
|
||||
LocalDate today = date.toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
|
||||
|
||||
System.out.println("LocalDate: " + today);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user