From c2ef001546ff304f997c0162e71edd0d7e0e228a Mon Sep 17 00:00:00 2001 From: fine <54142345+criver31@users.noreply.github.com> Date: Wed, 31 May 2023 09:35:08 +0800 Subject: [PATCH] Update MobilePositionResponseMessageHandler.java --- .../response/cmd/MobilePositionResponseMessageHandler.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/MobilePositionResponseMessageHandler.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/MobilePositionResponseMessageHandler.java index 332f3635..3e409a1b 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/MobilePositionResponseMessageHandler.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/MobilePositionResponseMessageHandler.java @@ -83,7 +83,10 @@ public class MobilePositionResponseMessageHandler extends SIPRequestProcessorPar } mobilePosition.setDeviceId(device.getDeviceId()); mobilePosition.setChannelId(getText(rootElement, "DeviceID")); - mobilePosition.setTime(getText(rootElement, "Time")); + //兼容ISO 8601格式时间 + String time = getText(rootElement, "Time"); + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); + mobilePosition.setTime(LocalDateTime.parse(time).format(formatter)); mobilePosition.setLongitude(Double.parseDouble(getText(rootElement, "Longitude"))); mobilePosition.setLatitude(Double.parseDouble(getText(rootElement, "Latitude"))); if (NumericUtil.isDouble(getText(rootElement, "Speed"))) {