LocalDateTime計算相差時間,不能直接減 java.time.Duration duration = java.time.Duration.between(LocalDateTime startTime, LocalDateTime endTime );java
java.time.Duration duration = java.time.Duration.between(LocalDateTime startTime, LocalDateTime endTime );
duration.toMinutes() //兩個時間差的分鐘數 toNanos()//納秒 toMillis()//毫秒