anashmamouch / open-gpstracker

Automatically exported from code.google.com/p/open-gpstracker
0 stars 0 forks source link

Timestamps in GPX export should use UTC (Zulu) timezone #105

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. record a track
2. share file as GPX
3. timestamps in the GPX show local time, not UTC (ZULU) time

What is the expected output? What do you see instead?
Expect to see UTC (Zulu) timestamps in the GPX file. I see local time
instead. See for example:
http://www.rigacci.org/wiki/doku.php/tecnica/gps_cartografia_gis/gpx

"The time that the point was recorded. Date and time in are in Univeral
Coordinated Time (UTC), not local time! Conforms to ISO 8601 specification
for date/time representation. Fractional seconds are allowed for
millisecond timing in tracklogs." 

Which Android device are you using?
HTC Hero

What version of Android are you running?
2.1 (Villain ROM 5.5)

Please provide any additional information below.
I have run into this same issue when working on http://geotracing.com . The
solution is to set the timezone in the date formatter in GpxCreator.java
lines 300+382  (maybe this also goes for KML, not checked)

The formatter can be set once, for example I use static init:

public static final SimpleDateFormat ZULU_DATE_FORMAT = new
SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");

static {

  // Zulu TZ is UTC

  // See http://mindprod.com/jgloss/calendar.html

  TimeZone utc = TimeZone.getTimeZone("UTC");

  ZULU_DATE_FORMAT.setTimeZone(utc);
}

Then each time element can be formatted as for example:

ZULU_DATE_FORMAT.format(new Date(aLongTime)));

Original issue reported on code.google.com by jus...@gmail.com on 19 May 2010 at 3:44

GoogleCodeExporter commented 9 years ago

Original comment by rcgr...@gmail.com on 22 May 2010 at 10:21

GoogleCodeExporter commented 9 years ago

Original comment by rcgr...@gmail.com on 22 May 2010 at 10:39