Merge pull request #1857 from sxh-nice/master

修复开始时间和结束时间写反问题
This commit is contained in:
648540858
2025-05-22 14:58:58 +08:00
committed by GitHub

View File

@@ -195,6 +195,14 @@ public class DateUtil {
}
Instant startInstant = Instant.from(formatter.parse(startTime));
Instant endInstant = Instant.from(formatter.parse(endTime));
return ChronoUnit.MILLIS.between(endInstant, startInstant);
return ChronoUnit.MILLIS.between(startInstant, endInstant);
}
public static void main(String[] args) {
long difference = getDifference("2025-05-21 13:00:00", "2025-05-21 13:30:00")/1000;
System.out.println(difference);
}
}