mirror of
https://gitee.com/pan648540858/wvp-GB28181-pro.git
synced 2026-05-25 14:37:53 +08:00
commit
706806a138
@ -195,6 +195,14 @@ public class DateUtil {
|
|||||||
}
|
}
|
||||||
Instant startInstant = Instant.from(formatter.parse(startTime));
|
Instant startInstant = Instant.from(formatter.parse(startTime));
|
||||||
Instant endInstant = Instant.from(formatter.parse(endTime));
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user