diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2019-05-27 08:08:14 -0700 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2019-05-27 08:08:14 -0700 |
commit | 2dd2aa777540ad08937943dec16925969f93c51a (patch) | |
tree | a91ca4f86c41c161a52b55d72512263e04a5e976 /src/main/java/org/traccar/protocol | |
parent | 437503927cdc7100fd31db5e9313d9f61bd24874 (diff) | |
download | traccar-server-2dd2aa777540ad08937943dec16925969f93c51a.tar.gz traccar-server-2dd2aa777540ad08937943dec16925969f93c51a.tar.bz2 traccar-server-2dd2aa777540ad08937943dec16925969f93c51a.zip |
Fix time decoding
Diffstat (limited to 'src/main/java/org/traccar/protocol')
-rw-r--r-- | src/main/java/org/traccar/protocol/MictrackProtocolDecoder.java | 6 |
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 { |