bailuk / AAT

Another Activity Tracker for Android
https://bailu.ch/aat
GNU General Public License v3.0
156 stars 41 forks source link

Local instead of UTC time written to GPX #14

Closed gaborigloi closed 7 years ago

gaborigloi commented 7 years ago

Thanks for this great app, I've found it quite reliable in general compared to other trackers! :) I've just recently noticed when I uploaded an activity to Strava, that the time is one hour off. I've looked at the .gpx file, and this was the original file:


    <trkpt lat="52.208421" lon="0.154026"><ele>58</ele><time>2017-07-29T17:26:05.644</time></trkpt>

When I downloaded the GPX from Strava, I got this:


   <trkpt lat="52.2084210" lon="0.1540260">
    <ele>11.6</ele>
    <time>2017-07-29T17:26:05Z</time>
   </trkpt>

So it seems from the Z at the end of the time string, that Strava interpreted the (UTC+1) local time as UTC.

bailuk commented 7 years ago

Thanks for the bug report!

AAT used to store time in local time, which did work (somehow) but of course doesn't comply to standards. I've changed it to write time stamps correctly in UTC with the ending Z. When reading files AAT will interpret time as UTC if there is an ending Z. Else it will interpret the time stamp as local time to keep compatibility with old files.

This isn't throughly tested yet so I keep this issue open for some time

gaborigloi commented 7 years ago

Thanks a lot for fixing the issue! Looking forward to testing it in the next release :)

bailuk commented 7 years ago

I assume this works now.

gaborigloi commented 7 years ago

Yes, I've updated to the new version in f-droid, and everything worked fine, the times of the activities I uploaded to Strava were correct, thanks for fixing this! :)