aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/SmokeyProtocolDecoder.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2018-09-17 15:50:19 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2018-09-17 15:50:19 +1200
commit7e2ed343d2a6a03938c3f074417464c63d31fd59 (patch)
tree61dd514f7618ac07b56ccfd84f607e3d8b7c4b98 /src/org/traccar/protocol/SmokeyProtocolDecoder.java
parentda5286acb0c81f5b9bfe92eaa30e9759e3fff6b5 (diff)
downloadtrackermap-server-7e2ed343d2a6a03938c3f074417464c63d31fd59.tar.gz
trackermap-server-7e2ed343d2a6a03938c3f074417464c63d31fd59.tar.bz2
trackermap-server-7e2ed343d2a6a03938c3f074417464c63d31fd59.zip
Remove joda time library
Diffstat (limited to 'src/org/traccar/protocol/SmokeyProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/SmokeyProtocolDecoder.java9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/org/traccar/protocol/SmokeyProtocolDecoder.java b/src/org/traccar/protocol/SmokeyProtocolDecoder.java
index 825108ed2..b9cef5ad4 100644
--- a/src/org/traccar/protocol/SmokeyProtocolDecoder.java
+++ b/src/org/traccar/protocol/SmokeyProtocolDecoder.java
@@ -19,9 +19,6 @@ import io.netty.buffer.ByteBuf;
import io.netty.buffer.ByteBufUtil;
import io.netty.buffer.Unpooled;
import io.netty.channel.Channel;
-import org.joda.time.DateTime;
-import org.joda.time.DateTimeZone;
-import org.joda.time.Seconds;
import org.traccar.BaseProtocolDecoder;
import org.traccar.DeviceSession;
import org.traccar.NetworkMessage;
@@ -33,6 +30,8 @@ import org.traccar.model.WifiAccessPoint;
import java.net.SocketAddress;
import java.nio.charset.StandardCharsets;
+import java.time.Instant;
+import java.time.temporal.ChronoUnit;
public class SmokeyProtocolDecoder extends BaseProtocolDecoder {
@@ -52,8 +51,8 @@ public class SmokeyProtocolDecoder extends BaseProtocolDecoder {
response.writeByte(3); // protocol version
response.writeByte(MSG_DATE_RECORD_ACK);
response.writeBytes(id);
- response.writeInt(Seconds.secondsBetween(
- new DateTime(2000, 1, 1, 0, 0, DateTimeZone.UTC), new DateTime(DateTimeZone.UTC)).getSeconds());
+ response.writeInt(
+ (int) ChronoUnit.SECONDS.between(Instant.parse("2000-01-01T00:00:00.00Z"), Instant.now()));
response.writeByte(index);
response.writeByte(report - 0x200);