diff options
-rw-r--r-- | src/main/java/org/traccar/protocol/PuiProtocolDecoder.java | 2 | ||||
-rw-r--r-- | src/test/java/org/traccar/protocol/PuiProtocolDecoderTest.java | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/main/java/org/traccar/protocol/PuiProtocolDecoder.java b/src/main/java/org/traccar/protocol/PuiProtocolDecoder.java index a80af65fb..f10ff3fe7 100644 --- a/src/main/java/org/traccar/protocol/PuiProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/PuiProtocolDecoder.java @@ -51,7 +51,7 @@ public class PuiProtocolDecoder extends BaseMqttProtocolDecoder { position.setValid(true); - DateFormat dateFormat = new SimpleDateFormat("yyyyMMdd'T'HHmmss.SSS'Z'"); + DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"); position.setTime(dateFormat.parse(json.getString("ts"))); JsonObject location = json.getJsonObject("location"); diff --git a/src/test/java/org/traccar/protocol/PuiProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/PuiProtocolDecoderTest.java index 41568d0c1..1bbf17361 100644 --- a/src/test/java/org/traccar/protocol/PuiProtocolDecoderTest.java +++ b/src/test/java/org/traccar/protocol/PuiProtocolDecoderTest.java @@ -16,7 +16,7 @@ public class PuiProtocolDecoderTest extends ProtocolTest { "123456789012345").build()); verifyPosition(decoder, MqttMessageBuilders.publish().payload(buffer( - "{ \"id\": \"015262001044848\", \"ts\": \"20190109T021918.312Z\", \"rpt\": \"hf\", \"location\": { \"lat\": 33.91233, \"lon\": -84.20784 }, \"bear\": 70, \"spd\": 2482, \"ign\": \"on\" }")).qos(MqttQoS.EXACTLY_ONCE).messageId(1).build()); + "{ \"id\": \"015262001044848\", \"ts\": \"2023-06-01T03:09:51.362Z\", \"rpt\": \"hf\", \"location\": { \"lat\": 33.91233, \"lon\": -84.20784 }, \"bear\": 70, \"spd\": 2482, \"ign\": \"on\" }")).qos(MqttQoS.EXACTLY_ONCE).messageId(1).build()); } |