|
@@ -564,7 +564,7 @@ public class DateUtil {
|
|
|
|
|
|
long epochSecond = early.toInstant().getEpochSecond();
|
|
|
long epochSecond1 = late.toInstant().getEpochSecond();
|
|
|
- return (int) (epochSecond1 - epochSecond)/(24*60*60) ;
|
|
|
+ return (int) (epochSecond1 - epochSecond +1)/(24*60*60) ;
|
|
|
// Calendar c1 = Calendar.getInstance();
|
|
|
// Calendar c2 = Calendar.getInstance();
|
|
|
// c1.setTime(early);
|
|
@@ -1517,7 +1517,7 @@ public class DateUtil {
|
|
|
|
|
|
public static void main(String[] args) throws ParseException {
|
|
|
Date from = Date.from(LocalDateTime.of(2024, 7, 27, 23, 59, 59).atZone(ZoneId.systemDefault()).toInstant());
|
|
|
- Date start = Date.from(LocalDateTime.of(2024, 7, 27, 23, 59, 59).atZone(ZoneId.systemDefault()).toInstant());
|
|
|
+ Date start = Date.from(LocalDateTime.of(2024, 7, 26, 0, 0, 0).atZone(ZoneId.systemDefault()).toInstant());
|
|
|
System.out.println(daysBetween(start, from));
|
|
|
// DateFormat df = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
// DateFormat df1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|