diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2018-11-08 13:37:38 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2018-11-08 13:37:38 +1300 |
commit | 9c9370f72c51d7466d3b25a59264ee98f4319b3a (patch) | |
tree | 1fca14e8a624e79f86b913dc60f94a93513a8eb0 /src/org/traccar/protocol/OsmAndProtocolDecoder.java | |
parent | 81d2b86ac7cca874b32c94fffa28b902c6fb0eca (diff) | |
download | trackermap-server-9c9370f72c51d7466d3b25a59264ee98f4319b3a.tar.gz trackermap-server-9c9370f72c51d7466d3b25a59264ee98f4319b3a.tar.bz2 trackermap-server-9c9370f72c51d7466d3b25a59264ee98f4319b3a.zip |
Fix time formatting issues
Diffstat (limited to 'src/org/traccar/protocol/OsmAndProtocolDecoder.java')
-rw-r--r-- | src/org/traccar/protocol/OsmAndProtocolDecoder.java | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/org/traccar/protocol/OsmAndProtocolDecoder.java b/src/org/traccar/protocol/OsmAndProtocolDecoder.java index e2aaeb7b6..3bc71de81 100644 --- a/src/org/traccar/protocol/OsmAndProtocolDecoder.java +++ b/src/org/traccar/protocol/OsmAndProtocolDecoder.java @@ -20,9 +20,9 @@ import io.netty.handler.codec.http.FullHttpRequest; import io.netty.handler.codec.http.HttpResponseStatus; import io.netty.handler.codec.http.QueryStringDecoder; import org.traccar.BaseHttpProtocolDecoder; -import org.traccar.Context; import org.traccar.DeviceSession; import org.traccar.Protocol; +import org.traccar.helper.DateUtil; import org.traccar.model.CellTower; import org.traccar.model.Network; import org.traccar.model.Position; @@ -32,7 +32,6 @@ import java.net.SocketAddress; import java.nio.charset.StandardCharsets; import java.text.DateFormat; import java.text.SimpleDateFormat; -import java.time.Instant; import java.util.Date; import java.util.List; import java.util.Map; @@ -83,8 +82,7 @@ public class OsmAndProtocolDecoder extends BaseHttpProtocolDecoder { position.setTime(new Date(timestamp)); } catch (NumberFormatException error) { if (value.contains("T")) { - position.setTime( - Date.from(Instant.from(Context.DATE_FORMATTER.parse(value)))); + position.setTime(DateUtil.parseDate(value)); } else { DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); position.setTime(dateFormat.parse(value)); |