📌  相关文章
📜  两个日期之间的 djava 天数 - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:29.059000             🧑  作者: Mango

代码示例1
//24-May-2017, change this to your desired Start Date
LocalDate dateBefore = LocalDate.of(2017, Month.MAY, 24);
//29-July-2017, change this to your desired End Date
LocalDate dateAfter = LocalDate.of(2017, Month.JULY, 29);
long noOfDaysBetween = ChronoUnit.DAYS.between(dateBefore, dateAfter);
System.out.println(noOfDaysBetween);