diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2018-09-17 15:50:19 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2018-09-17 15:50:19 +1200 |
commit | 7e2ed343d2a6a03938c3f074417464c63d31fd59 (patch) | |
tree | 61dd514f7618ac07b56ccfd84f607e3d8b7c4b98 /src/org/traccar/protocol/OsmAndProtocolDecoder.java | |
parent | da5286acb0c81f5b9bfe92eaa30e9759e3fff6b5 (diff) | |
download | trackermap-server-7e2ed343d2a6a03938c3f074417464c63d31fd59.tar.gz trackermap-server-7e2ed343d2a6a03938c3f074417464c63d31fd59.tar.bz2 trackermap-server-7e2ed343d2a6a03938c3f074417464c63d31fd59.zip |
Remove joda time library
Diffstat (limited to 'src/org/traccar/protocol/OsmAndProtocolDecoder.java')
-rw-r--r-- | src/org/traccar/protocol/OsmAndProtocolDecoder.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/org/traccar/protocol/OsmAndProtocolDecoder.java b/src/org/traccar/protocol/OsmAndProtocolDecoder.java index b270b6071..4d6a0d259 100644 --- a/src/org/traccar/protocol/OsmAndProtocolDecoder.java +++ b/src/org/traccar/protocol/OsmAndProtocolDecoder.java @@ -19,7 +19,6 @@ import io.netty.channel.Channel; import io.netty.handler.codec.http.FullHttpRequest; import io.netty.handler.codec.http.HttpResponseStatus; import io.netty.handler.codec.http.QueryStringDecoder; -import org.joda.time.format.ISODateTimeFormat; import org.traccar.BaseHttpProtocolDecoder; import org.traccar.DeviceSession; import org.traccar.model.CellTower; @@ -31,6 +30,8 @@ import java.net.SocketAddress; 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; @@ -81,8 +82,8 @@ public class OsmAndProtocolDecoder extends BaseHttpProtocolDecoder { position.setTime(new Date(timestamp)); } catch (NumberFormatException error) { if (value.contains("T")) { - position.setTime(new Date( - ISODateTimeFormat.dateTimeParser().parseMillis(value))); + position.setTime( + Date.from(Instant.from(DateTimeFormatter.ISO_DATE_TIME.parse(value)))); } else { DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); position.setTime(dateFormat.parse(value)); |