aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/MiniFinderProtocolEncoder.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar/protocol/MiniFinderProtocolEncoder.java')
-rw-r--r--src/org/traccar/protocol/MiniFinderProtocolEncoder.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/org/traccar/protocol/MiniFinderProtocolEncoder.java b/src/org/traccar/protocol/MiniFinderProtocolEncoder.java
index e5c43e29a..7cf19d352 100644
--- a/src/org/traccar/protocol/MiniFinderProtocolEncoder.java
+++ b/src/org/traccar/protocol/MiniFinderProtocolEncoder.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;
@@ -27,7 +29,7 @@ public class MiniFinderProtocolEncoder extends StringProtocolEncoder implements
if (key.equals(Command.KEY_ENABLE)) {
return (Boolean) value ? "1" : "0";
} else if (key.equals(Command.KEY_TIMEZONE)) {
- return String.format("%+03d", ((Number) value).longValue() / 3600);
+ return String.format("%+03d", TimeZone.getTimeZone(value.toString()).getRawOffset() / 3600000);
} else if (key.equals(Command.KEY_INDEX)) {
switch (((Number) value).intValue()) {
case 0: