diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2015-09-13 10:53:00 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2015-09-13 10:53:00 +1200 |
commit | 64cfb89dcd87280559ec6d5867c8f309b9df4181 (patch) | |
tree | b071f4edd910d59268ac0be685d74ba6162090ef /src | |
parent | 9cc4cb27a5de80794f11a2e659ecde0e44bbb7b6 (diff) | |
download | traccar-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.java | 6 |
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))); |