aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2018-09-22 11:40:02 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2018-09-22 11:40:02 +1200
commita7296d99876000e65bef9b9df708f57ebabbe894 (patch)
tree27175047d4b59b55c3e59d5bfafff96255570202 /src/org/traccar/protocol
parent02d5eb894a4c5f5fe8270303af2c8ba4be03b530 (diff)
downloadtrackermap-server-a7296d99876000e65bef9b9df708f57ebabbe894.tar.gz
trackermap-server-a7296d99876000e65bef9b9df708f57ebabbe894.tar.bz2
trackermap-server-a7296d99876000e65bef9b9df708f57ebabbe894.zip
Fix date formatting (fix #4063)
Diffstat (limited to 'src/org/traccar/protocol')
-rw-r--r--src/org/traccar/protocol/OsmAndProtocolDecoder.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/org/traccar/protocol/OsmAndProtocolDecoder.java b/src/org/traccar/protocol/OsmAndProtocolDecoder.java
index 4d6a0d259..ab2bc7c7d 100644
--- a/src/org/traccar/protocol/OsmAndProtocolDecoder.java
+++ b/src/org/traccar/protocol/OsmAndProtocolDecoder.java
@@ -20,6 +20,7 @@ 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.model.CellTower;
import org.traccar.model.Network;
@@ -31,7 +32,6 @@ import java.nio.charset.StandardCharsets;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.time.Instant;
-import java.time.format.DateTimeFormatter;
import java.util.Date;
import java.util.List;
import java.util.Map;
@@ -83,7 +83,7 @@ public class OsmAndProtocolDecoder extends BaseHttpProtocolDecoder {
} catch (NumberFormatException error) {
if (value.contains("T")) {
position.setTime(
- Date.from(Instant.from(DateTimeFormatter.ISO_DATE_TIME.parse(value))));
+ Date.from(Instant.from(Context.DATE_FORMATTER.parse(value))));
} else {
DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
position.setTime(dateFormat.parse(value));