From 7055c53192aadf6af9444c81373ab256e760b808 Mon Sep 17 00:00:00 2001 From: hexq <hexiaoqu@visioninsight.com> Date: 星期六, 20 一月 2024 10:26:49 +0800 Subject: [PATCH] BUGFIX:回放时,优先从SDP中提取channelId,兼容从Subject无法提取到channelId的问题 --- src/main/java/com/genersoft/iot/vmp/utils/DateUtil.java | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/utils/DateUtil.java b/src/main/java/com/genersoft/iot/vmp/utils/DateUtil.java index 617d9f2..e5f9fe4 100755 --- a/src/main/java/com/genersoft/iot/vmp/utils/DateUtil.java +++ b/src/main/java/com/genersoft/iot/vmp/utils/DateUtil.java @@ -139,4 +139,13 @@ Instant beforeInstant = Instant.from(formatter.parse(keepaliveTime)); return ChronoUnit.MILLIS.between(beforeInstant, Instant.now()); } + + public static long getDifference(String startTime, String endTime) { + if (ObjectUtils.isEmpty(startTime) || ObjectUtils.isEmpty(endTime)) { + return 0; + } + Instant startInstant = Instant.from(formatter.parse(startTime)); + Instant endInstant = Instant.from(formatter.parse(endTime)); + return ChronoUnit.MILLIS.between(endInstant, startInstant); + } } -- Gitblit v1.8.0