Drollton / robertprojects

Automatically exported from code.google.com/p/robertprojects
0 stars 0 forks source link

The exported gpx file has the incorrect time #89

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. export gpx file

The exported gpx file has the incorrect time.
Each point should have its own recording time instead of the exporting time.

What version of the product are you using?
v0.8.3.1

Original issue reported on code.google.com by tyt...@gmail.com on 30 Jun 2010 at 12:03

GoogleCodeExporter commented 8 years ago
Seems to be solved with r273.
I am in doubt if System.currentTimeMillis() is the right one or if 
loc.getTime() is better. 
loc.getTime delivers the time of the last fix. In my experiments it delivers 
local time instead of UTC in exported gpx file.

Original comment by joerg.go...@gmail.com on 8 Aug 2010 at 8:44

GoogleCodeExporter commented 8 years ago
Every point has its own recording time (i.e. loc.getTime).
In my experience, storing the UTC time into the database will be the best 
choice.
If someone records the track in one place whose TimeOffset is +8, the database 
will store the UTCtime=localTime-8.
When he goes to another place whose TimeOffset is +2, and he wants to export 
the track, then UTCtime is exported to a gpx file.
If he wants to see the recording time, then time=UTCtime+2 is displayed on the 
app.

If the database only stores the local time, we must also store the time offset, 
otherwise, the scenario above cannot be done.

If anyone has interest, you can refer my code about solving the UTC time issue.
http://code.google.com/p/big-planet-tracks/source/browse/BigPlanetTracks/src/tyt
/android/bigplanettracks/tracks/MyTimeUtils.java
public static String getGMTTimeString(long millisecond);
public static String getLocalTimeString(String strGMTTime);

Original comment by tyt...@gmail.com on 10 Aug 2010 at 5:19

GoogleCodeExporter commented 8 years ago

Original comment by RobertK...@gmail.com on 11 Jan 2011 at 11:21