diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2013-08-22 23:42:41 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2013-08-22 23:42:41 +1200 |
commit | af665d2ea2420b3efb54c5ff91986772b6b5a025 (patch) | |
tree | 5d0720090a6bca2d45003d68637f0db6d8c45e70 | |
parent | 0fa340eb62473efa698ddaed783340535f4b2ee0 (diff) | |
download | trackermap-server-af665d2ea2420b3efb54c5ff91986772b6b5a025.tar.gz trackermap-server-af665d2ea2420b3efb54c5ff91986772b6b5a025.tar.bz2 trackermap-server-af665d2ea2420b3efb54c5ff91986772b6b5a025.zip |
Fix totem date decoding
-rw-r--r-- | src/org/traccar/protocol/TotemProtocolDecoder.java | 8 |
1 files 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 |