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())));

浙公网安备 33010602011771号