aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2019-05-27 08:08:14 -0700
committerAnton Tananaev <anton.tananaev@gmail.com>2019-05-27 08:08:14 -0700
commit2dd2aa777540ad08937943dec16925969f93c51a (patch)
treea91ca4f86c41c161a52b55d72512263e04a5e976 /src/main/java/org/traccar
parent437503927cdc7100fd31db5e9313d9f61bd24874 (diff)
downloadtrackermap-server-2dd2aa777540ad08937943dec16925969f93c51a.tar.gz
trackermap-server-2dd2aa777540ad08937943dec16925969f93c51a.tar.bz2
trackermap-server-2dd2aa777540ad08937943dec16925969f93c51a.zip
Fix time decoding
Diffstat (limited to 'src/main/java/org/traccar')
-rw-r--r--src/main/java/org/traccar/protocol/MictrackProtocolDecoder.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/main/java/org/traccar/protocol/MictrackProtocolDecoder.java b/src/main/java/org/traccar/protocol/MictrackProtocolDecoder.java
index c11c97df3..534937235 100644
--- a/src/main/java/org/traccar/protocol/MictrackProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/MictrackProtocolDecoder.java
@@ -26,9 +26,11 @@ import org.traccar.model.Position;
import org.traccar.model.WifiAccessPoint;
import java.net.SocketAddress;
+import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
+import java.util.TimeZone;
public class MictrackProtocolDecoder extends BaseProtocolDecoder {
@@ -37,7 +39,9 @@ public class MictrackProtocolDecoder extends BaseProtocolDecoder {
}
private Date decodeTime(String data) throws ParseException {
- return new SimpleDateFormat("yyMMddHHmmss").parse(data);
+ DateFormat dateFormat = new SimpleDateFormat("yyMMddHHmmss");
+ dateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
+ return dateFormat.parse(data);
}
private void decodeLocation(Position position, String data) throws ParseException {