From c0ca959ad982fa30f70f14a6deed011dadd628c2 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 20 Sep 2014 10:13:44 +1200 Subject: Add GT06 time correction (fix #881) --- src/org/traccar/protocol/Gt06ProtocolDecoder.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/org/traccar/protocol/Gt06ProtocolDecoder.java b/src/org/traccar/protocol/Gt06ProtocolDecoder.java index fef3e2f5b..a0ff5a0b8 100644 --- a/src/org/traccar/protocol/Gt06ProtocolDecoder.java +++ b/src/org/traccar/protocol/Gt06ProtocolDecoder.java @@ -16,6 +16,7 @@ package org.traccar.protocol; import java.util.Calendar; +import java.util.Properties; import java.util.TimeZone; import org.jboss.netty.buffer.ChannelBuffer; import org.jboss.netty.buffer.ChannelBuffers; @@ -35,6 +36,14 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder { public Gt06ProtocolDecoder(ServerManager serverManager) { super(serverManager); + + if (serverManager != null) { + Properties p = getServerManager().getProperties(); + if (p.contains("gt06.timezone")) { + timeZone.setRawOffset( + Integer.valueOf(p.getProperty("gt06.timezone")) * 1000); + } + } } private String readImei(ChannelBuffer buf) { -- cgit v1.2.3