aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-09-13 10:53:00 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2015-09-13 10:53:00 +1200
commit64cfb89dcd87280559ec6d5867c8f309b9df4181 (patch)
treeb071f4edd910d59268ac0be685d74ba6162090ef /src
parent9cc4cb27a5de80794f11a2e659ecde0e44bbb7b6 (diff)
downloadtraccar-server-64cfb89dcd87280559ec6d5867c8f309b9df4181.tar.gz
traccar-server-64cfb89dcd87280559ec6d5867c8f309b9df4181.tar.bz2
traccar-server-64cfb89dcd87280559ec6d5867c8f309b9df4181.zip
Fix OsmAnd timestamp issue
Diffstat (limited to 'src')
-rw-r--r--src/org/traccar/protocol/OsmAndProtocolDecoder.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/org/traccar/protocol/OsmAndProtocolDecoder.java b/src/org/traccar/protocol/OsmAndProtocolDecoder.java
index f89406a00..cf447c579 100644
--- a/src/org/traccar/protocol/OsmAndProtocolDecoder.java
+++ b/src/org/traccar/protocol/OsmAndProtocolDecoder.java
@@ -69,7 +69,11 @@ public class OsmAndProtocolDecoder extends BaseProtocolDecoder {
position.setValid(true);
if (params.containsKey("timestamp")) {
try {
- position.setTime(new Date(Long.valueOf(params.get("timestamp").get(0)) * 1000));
+ long timestamp = Long.valueOf(params.get("timestamp").get(0));
+ if (timestamp < Integer.MAX_VALUE) {
+ timestamp *= 1000;
+ }
+ position.setTime(new Date(timestamp));
} catch (NumberFormatException error) {
DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
position.setTime(dateFormat.parse(params.get("timestamp").get(0)));