aboutsummaryrefslogtreecommitdiff
path: root/src/org
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-03-03 10:06:31 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2015-03-03 10:06:31 +1300
commit9d1f42ab116aab02e62e553485a7c4fdc9e12168 (patch)
tree33c200473fe4a3210ce24f9d832fc32f5724d790 /src/org
parentcb5788df82324d999e1912a5936ade351f3da8da (diff)
downloadtrackermap-server-9d1f42ab116aab02e62e553485a7c4fdc9e12168.tar.gz
trackermap-server-9d1f42ab116aab02e62e553485a7c4fdc9e12168.tar.bz2
trackermap-server-9d1f42ab116aab02e62e553485a7c4fdc9e12168.zip
Allow to force GT06 timezone
Diffstat (limited to 'src/org')
-rw-r--r--src/org/traccar/protocol/Gt06ProtocolDecoder.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/org/traccar/protocol/Gt06ProtocolDecoder.java b/src/org/traccar/protocol/Gt06ProtocolDecoder.java
index 12187e1ed..1d81bb351 100644
--- a/src/org/traccar/protocol/Gt06ProtocolDecoder.java
+++ b/src/org/traccar/protocol/Gt06ProtocolDecoder.java
@@ -33,6 +33,7 @@ import java.util.TimeZone;
public class Gt06ProtocolDecoder extends BaseProtocolDecoder {
private Long deviceId;
+ private boolean forceTimeZone = false;
private final TimeZone timeZone = TimeZone.getTimeZone("UTC");
public Gt06ProtocolDecoder(DataManager dataManager, String protocol, Properties properties) {
@@ -40,6 +41,7 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder {
if (properties != null) {
if (properties.containsKey(protocol + ".timezone")) {
+ forceTimeZone = true;
timeZone.setRawOffset(
Integer.valueOf(properties.getProperty(protocol + ".timezone")) * 1000);
}
@@ -120,7 +122,9 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder {
if ((extensionBits & 0x8) != 0) {
offset = -offset;
}
- timeZone.setRawOffset(offset);
+ if (!forceTimeZone) {
+ timeZone.setRawOffset(offset);
+ }
}
try {