public static void main(String[] args) {
LocalDateTime endTime = LocalDateTime.of(LocalDateTime.now().getYear(),
LocalDateTime.now().getMonth(),
LocalDateTime.now().withDayOfMonth(15).getDayOfMonth(), 23, 59, 59);
Duration dur = Duration.between(endTime, LocalDateTime.now());
long toDays = dur.toDays();
System.out.println(toDays);
}
Duration.between的格式注意下~~~