aboutsummaryrefslogtreecommitdiff
path: root/src/org
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2013-08-22 23:42:41 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2013-08-22 23:42:41 +1200
commitaf665d2ea2420b3efb54c5ff91986772b6b5a025 (patch)
tree5d0720090a6bca2d45003d68637f0db6d8c45e70 /src/org
parent0fa340eb62473efa698ddaed783340535f4b2ee0 (diff)
downloadtraccar-server-af665d2ea2420b3efb54c5ff91986772b6b5a025.tar.gz
traccar-server-af665d2ea2420b3efb54c5ff91986772b6b5a025.tar.bz2
traccar-server-af665d2ea2420b3efb54c5ff91986772b6b5a025.zip
Fix totem date decoding
Diffstat (limited to 'src/org')
-rw-r--r--src/org/traccar/protocol/TotemProtocolDecoder.java8
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