diff options
3 files changed, 6 insertions, 3 deletions
diff --git a/src/net/sourceforge/opentracking/protocol/gps103/Gps103ProtocolDecoder.java b/src/net/sourceforge/opentracking/protocol/gps103/Gps103ProtocolDecoder.java index 92d54b551..faccc97d7 100644 --- a/src/net/sourceforge/opentracking/protocol/gps103/Gps103ProtocolDecoder.java +++ b/src/net/sourceforge/opentracking/protocol/gps103/Gps103ProtocolDecoder.java @@ -17,6 +17,7 @@ package net.sourceforge.opentracking.protocol.gps103; import java.util.Calendar; import java.util.GregorianCalendar; +import java.util.TimeZone; import java.util.Timer; import java.util.TimerTask; import java.util.regex.Pattern; @@ -106,7 +107,7 @@ public class Gps103ProtocolDecoder extends OneToOneDecoder { position.setDeviceId(dataManager.getDeviceByImei(imei).getId()); // Date - Calendar time = new GregorianCalendar(); + Calendar time = new GregorianCalendar(TimeZone.getTimeZone("UTC")); time.clear(); time.set(Calendar.YEAR, 2000 + Integer.valueOf(parser.group(index++))); time.set(Calendar.MONTH, Integer.valueOf(parser.group(index++)) - 1); diff --git a/src/net/sourceforge/opentracking/protocol/tk103/Tk103ProtocolDecoder.java b/src/net/sourceforge/opentracking/protocol/tk103/Tk103ProtocolDecoder.java index c11d22a17..2ff6ce949 100644 --- a/src/net/sourceforge/opentracking/protocol/tk103/Tk103ProtocolDecoder.java +++ b/src/net/sourceforge/opentracking/protocol/tk103/Tk103ProtocolDecoder.java @@ -17,6 +17,7 @@ package net.sourceforge.opentracking.protocol.tk103; import java.util.Calendar; import java.util.GregorianCalendar; +import java.util.TimeZone; import java.util.Timer; import java.util.TimerTask; import java.util.regex.Pattern; @@ -104,7 +105,7 @@ public class Tk103ProtocolDecoder extends OneToOneDecoder { position.setDeviceId(dataManager.getDeviceByImei(imei).getId()); // Date - Calendar time = new GregorianCalendar(); + Calendar time = new GregorianCalendar(TimeZone.getTimeZone("UTC")); time.clear(); time.set(Calendar.YEAR, 2000 + Integer.valueOf(parser.group(index++))); time.set(Calendar.MONTH, Integer.valueOf(parser.group(index++)) - 1); diff --git a/src/net/sourceforge/opentracking/protocol/xexun/XexunProtocolDecoder.java b/src/net/sourceforge/opentracking/protocol/xexun/XexunProtocolDecoder.java index 865d1cf72..afd2405c8 100644 --- a/src/net/sourceforge/opentracking/protocol/xexun/XexunProtocolDecoder.java +++ b/src/net/sourceforge/opentracking/protocol/xexun/XexunProtocolDecoder.java @@ -20,6 +20,7 @@ import java.util.GregorianCalendar; import java.util.regex.Pattern; import java.util.regex.Matcher; import java.text.ParseException; +import java.util.TimeZone; import java.util.Timer; import java.util.TimerTask; import org.jboss.netty.channel.Channel; @@ -91,7 +92,7 @@ public class XexunProtocolDecoder extends OneToOneDecoder { Integer index = 1; // Time - Calendar time = new GregorianCalendar(); + Calendar time = new GregorianCalendar(TimeZone.getTimeZone("UTC")); time.clear(); time.set(Calendar.HOUR, Integer.valueOf(parser.group(index++))); time.set(Calendar.MINUTE, Integer.valueOf(parser.group(index++))); |