aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/HuabaoProtocolDecoder.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2018-07-26 01:33:29 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2018-07-26 01:33:29 +1200
commit78d7d9cb121115b064a6c9ed8fcaccc2dfd0a825 (patch)
treede4e660d2b1569fc9f86d9952d2161301baab4d6 /src/org/traccar/protocol/HuabaoProtocolDecoder.java
parent7c8e00eba940fdbcde3ea2b60e6094caa9098b99 (diff)
downloadtrackermap-server-78d7d9cb121115b064a6c9ed8fcaccc2dfd0a825.tar.gz
trackermap-server-78d7d9cb121115b064a6c9ed8fcaccc2dfd0a825.tar.bz2
trackermap-server-78d7d9cb121115b064a6c9ed8fcaccc2dfd0a825.zip
Make Huabao timezone configurable
Diffstat (limited to 'src/org/traccar/protocol/HuabaoProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/HuabaoProtocolDecoder.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/org/traccar/protocol/HuabaoProtocolDecoder.java b/src/org/traccar/protocol/HuabaoProtocolDecoder.java
index b92840dfc..e5ee30fcf 100644
--- a/src/org/traccar/protocol/HuabaoProtocolDecoder.java
+++ b/src/org/traccar/protocol/HuabaoProtocolDecoder.java
@@ -120,6 +120,10 @@ public class HuabaoProtocolDecoder extends BaseProtocolDecoder {
return null;
}
+ if (deviceSession.getTimeZone() == null) {
+ deviceSession.setTimeZone(getTimeZone(deviceSession.getDeviceId(), "GMT+8"));
+ }
+
if (type == MSG_TERMINAL_REGISTER) {
if (channel != null) {
@@ -180,7 +184,7 @@ public class HuabaoProtocolDecoder extends BaseProtocolDecoder {
position.setSpeed(UnitsConverter.knotsFromKph(buf.readUnsignedShort() * 0.1));
position.setCourse(buf.readUnsignedShort());
- DateBuilder dateBuilder = new DateBuilder(TimeZone.getTimeZone("GMT+8"))
+ DateBuilder dateBuilder = new DateBuilder(deviceSession.getTimeZone())
.setYear(BcdUtil.readInteger(buf, 2))
.setMonth(BcdUtil.readInteger(buf, 2))
.setDay(BcdUtil.readInteger(buf, 2))