aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/Jt600ProtocolEncoder.java
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2017-09-04 18:01:43 +0500
committerAbyss777 <abyss@fox5.ru>2017-09-04 18:01:43 +0500
commit87392d9fbb0289b5486496b6e6b97db1ea84e2b7 (patch)
tree6d8413ad76307ee7bc52b5788dc202bb55762958 /src/org/traccar/protocol/Jt600ProtocolEncoder.java
parent99fd421c76c8e7491095a91630516f6d2db27034 (diff)
downloadtrackermap-server-87392d9fbb0289b5486496b6e6b97db1ea84e2b7.tar.gz
trackermap-server-87392d9fbb0289b5486496b6e6b97db1ea84e2b7.tar.bz2
trackermap-server-87392d9fbb0289b5486496b6e6b97db1ea84e2b7.zip
Accept timezone id instead of offset in commands
Diffstat (limited to 'src/org/traccar/protocol/Jt600ProtocolEncoder.java')
-rw-r--r--src/org/traccar/protocol/Jt600ProtocolEncoder.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/org/traccar/protocol/Jt600ProtocolEncoder.java b/src/org/traccar/protocol/Jt600ProtocolEncoder.java
index 0bf389460..377f104a3 100644
--- a/src/org/traccar/protocol/Jt600ProtocolEncoder.java
+++ b/src/org/traccar/protocol/Jt600ProtocolEncoder.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2016 Anton Tananaev (anton@traccar.org)
+ * Copyright 2016 - 2017 Anton Tananaev (anton@traccar.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,6 +15,8 @@
*/
package org.traccar.protocol;
+import java.util.TimeZone;
+
import org.traccar.StringProtocolEncoder;
import org.traccar.helper.Log;
import org.traccar.model.Command;
@@ -29,7 +31,7 @@ public class Jt600ProtocolEncoder extends StringProtocolEncoder {
case Command.TYPE_ENGINE_RESUME:
return "(S07,1)";
case Command.TYPE_SET_TIMEZONE:
- int offset = command.getInteger(Command.KEY_TIMEZONE) / 60;
+ int offset = TimeZone.getTimeZone(command.getString(Command.KEY_TIMEZONE)).getRawOffset() / 60000;
return "(S09,1," + offset + ")";
case Command.TYPE_REBOOT_DEVICE:
return "(S17)";