This commit is contained in:
张良(004796)
2024-02-05 17:34:43 +08:00
parent 99e0772540
commit 18f9838338
9 changed files with 226 additions and 17 deletions

View File

@@ -19,6 +19,10 @@ public class CaiDateUtil {
return ChronoUnit.SECONDS.between(after, before);
}
public static long diffDays(LocalDateTime before, LocalDateTime after){
return ChronoUnit.DAYS.between(after, before);
}
public static String betweenShowString(LocalDateTime minTime,LocalDateTime maxTime){
Duration duration = Duration.between(minTime, maxTime);
long seconds = duration.getSeconds();
@@ -102,4 +106,8 @@ public class CaiDateUtil {
public static String getCurrentTimeStr() {
return localDateTimeToString(LocalDateTime.now());
}
public static String formatDate(LocalDate begin) {
return begin.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
}
}