java 生成一个指定日期和当前日期,并做对比,早于等于当前日期返回false,晚于当前日期返回true


System.out.println(Date.from(
(LocalDate.of(2024,6,7)
.atStartOfDay()
.toInstant(ZoneOffset.ofHours(8)))
).
after(Date.from(
(LocalDate.now()
.atTime(LocalTime.MIDNIGHT)
.atZone(ZoneId.systemDefault()))
.toInstant())));
posted @ 2024-06-07 10:34  Lee597  阅读(69)  评论(0)    收藏  举报