diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2016-01-02 09:24:45 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2016-01-02 09:24:45 +1300 |
commit | 865c6e3fdccc5b59b55501aa58fd921cdb8a1ec1 (patch) | |
tree | 6cc58652c2434aa54465ac9ebdb06d3a45dff314 /src/org/traccar/protocol/TramigoProtocolDecoder.java | |
parent | bb61bf04166a539627c8bcaefcf30e241d47a27a (diff) | |
download | trackermap-server-865c6e3fdccc5b59b55501aa58fd921cdb8a1ec1.tar.gz trackermap-server-865c6e3fdccc5b59b55501aa58fd921cdb8a1ec1.tar.bz2 trackermap-server-865c6e3fdccc5b59b55501aa58fd921cdb8a1ec1.zip |
Correct date if device sends not full time
Diffstat (limited to 'src/org/traccar/protocol/TramigoProtocolDecoder.java')
-rw-r--r-- | src/org/traccar/protocol/TramigoProtocolDecoder.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/org/traccar/protocol/TramigoProtocolDecoder.java b/src/org/traccar/protocol/TramigoProtocolDecoder.java index da34bcdfa..10bab3d6c 100644 --- a/src/org/traccar/protocol/TramigoProtocolDecoder.java +++ b/src/org/traccar/protocol/TramigoProtocolDecoder.java @@ -28,6 +28,7 @@ import org.jboss.netty.buffer.ChannelBuffer; import org.jboss.netty.buffer.ChannelBuffers; import org.jboss.netty.channel.Channel; import org.traccar.BaseProtocolDecoder; +import org.traccar.helper.DateUtil; import org.traccar.helper.UnitsConverter; import org.traccar.model.Event; import org.traccar.model.Position; @@ -126,7 +127,8 @@ public class TramigoProtocolDecoder extends BaseProtocolDecoder { return null; } DateFormat dateFormat = new SimpleDateFormat("HH:mm MMM d yyyy", Locale.ENGLISH); - position.setTime(dateFormat.parse(matcher.group(1) + " " + Calendar.getInstance().get(Calendar.YEAR))); + position.setTime(DateUtil.correctYear( + dateFormat.parse(matcher.group(1) + " " + Calendar.getInstance().get(Calendar.YEAR)))); return position; |