diff options
Diffstat (limited to 'src/org/traccar')
4 files changed, 5 insertions, 5 deletions
diff --git a/src/org/traccar/database/DataManager.java b/src/org/traccar/database/DataManager.java index 7bcfeac31..27d03ca08 100644 --- a/src/org/traccar/database/DataManager.java +++ b/src/org/traccar/database/DataManager.java @@ -119,7 +119,7 @@ public class DataManager implements IdentityManager { @Override public Device getDeviceByUniqueId(String uniqueId) throws SQLException { - if ((new Date().getTime() - devicesLastUpdate > devicesRefreshDelay) || !devicesByUniqueId.containsKey(uniqueId)) { + if ((System.currentTimeMillis() - devicesLastUpdate > devicesRefreshDelay) || !devicesByUniqueId.containsKey(uniqueId)) { devicesById.clear(); devicesByUniqueId.clear(); @@ -127,7 +127,7 @@ public class DataManager implements IdentityManager { devicesById.put(device.getId(), device); devicesByUniqueId.put(device.getUniqueId(), device); } - devicesLastUpdate = new Date().getTime(); + devicesLastUpdate = System.currentTimeMillis(); } return devicesByUniqueId.get(uniqueId); diff --git a/src/org/traccar/protocol/CastelProtocolDecoder.java b/src/org/traccar/protocol/CastelProtocolDecoder.java index 358f6bb1d..95862cc9a 100644 --- a/src/org/traccar/protocol/CastelProtocolDecoder.java +++ b/src/org/traccar/protocol/CastelProtocolDecoder.java @@ -123,7 +123,7 @@ public class CastelProtocolDecoder extends BaseProtocolDecoder { response.writeShort(ChannelBuffers.swapShort(MSG_LOGIN_RESPONSE)); response.writeInt(0xFFFFFFFF); response.writeShort(0); - response.writeInt((int) (new Date().getTime() / 1000)); + response.writeInt((int) (System.currentTimeMillis() / 1000)); response.writeShort(Crc.crc16Ccitt(response.toByteBuffer(0, response.writerIndex()))); response.writeByte(0x0D); response.writeByte(0x0A); channel.write(response, remoteAddress); diff --git a/src/org/traccar/protocol/NavigilProtocolDecoder.java b/src/org/traccar/protocol/NavigilProtocolDecoder.java index 2b75e7840..7938fd7cc 100644 --- a/src/org/traccar/protocol/NavigilProtocolDecoder.java +++ b/src/org/traccar/protocol/NavigilProtocolDecoder.java @@ -70,7 +70,7 @@ public class NavigilProtocolDecoder extends BaseProtocolDecoder { header.writeShort(0); header.writeShort(Crc.crc16X25Ccitt(data.toByteBuffer())); header.writeInt(0); - header.writeInt((int) (new Date().getTime() / 1000) + LEAP_SECONDS_DELTA); + header.writeInt((int) (System.currentTimeMillis() / 1000) + LEAP_SECONDS_DELTA); if (channel != null) { channel.write(ChannelBuffers.copiedBuffer(header, data)); diff --git a/src/org/traccar/protocol/TaipProtocolDecoder.java b/src/org/traccar/protocol/TaipProtocolDecoder.java index 8c1448193..252f4e712 100644 --- a/src/org/traccar/protocol/TaipProtocolDecoder.java +++ b/src/org/traccar/protocol/TaipProtocolDecoder.java @@ -75,7 +75,7 @@ public class TaipProtocolDecoder extends BaseProtocolDecoder { long millis = time.getTimeInMillis() + seconds * 1000; - long diff = new Date().getTime() - millis; + long diff = System.currentTimeMillis() - millis; if (diff > 12 * 60 * 60 * 1000) { millis += 24 * 60 * 60 * 1000; |