From af665d2ea2420b3efb54c5ff91986772b6b5a025 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Thu, 22 Aug 2013 23:42:41 +1200 Subject: Fix totem date decoding --- src/org/traccar/protocol/TotemProtocolDecoder.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/org/traccar/protocol/TotemProtocolDecoder.java b/src/org/traccar/protocol/TotemProtocolDecoder.java index 73bb18aac..55698893c 100644 --- a/src/org/traccar/protocol/TotemProtocolDecoder.java +++ b/src/org/traccar/protocol/TotemProtocolDecoder.java @@ -125,10 +125,10 @@ public class TotemProtocolDecoder extends BaseProtocolDecoder { time.clear(); int year = 0; if (!first) { + time.set(Calendar.DAY_OF_MONTH, Integer.valueOf(parser.group(index++))); + time.set(Calendar.MONTH, Integer.valueOf(parser.group(index++)) - 1); year = Integer.valueOf(parser.group(index++)); time.set(Calendar.YEAR, 2000 + year); - time.set(Calendar.MONTH, Integer.valueOf(parser.group(index++)) - 1); - time.set(Calendar.DAY_OF_MONTH, Integer.valueOf(parser.group(index++))); } time.set(Calendar.HOUR, Integer.valueOf(parser.group(index++))); time.set(Calendar.MINUTE, Integer.valueOf(parser.group(index++))); @@ -167,10 +167,10 @@ public class TotemProtocolDecoder extends BaseProtocolDecoder { // Date if (first) { + time.set(Calendar.DAY_OF_MONTH, Integer.valueOf(parser.group(index++))); + time.set(Calendar.MONTH, Integer.valueOf(parser.group(index++)) - 1); year = Integer.valueOf(parser.group(index++)); time.set(Calendar.YEAR, 2000 + year); - time.set(Calendar.MONTH, Integer.valueOf(parser.group(index++)) - 1); - time.set(Calendar.DAY_OF_MONTH, Integer.valueOf(parser.group(index++))); } if (year == 0) { return null; // ignore invalid data -- cgit v1.2.3