GPSBabel / gpsbabel

GPSBabel: convert, manipulate, and transfer data from GPS programs or GPS receivers. Open Source and supported on MacOS, Windows, Linux, and more. Pointy clicky GUI or a command line version...
https://www.gpsbabel.org
GNU General Public License v2.0
473 stars 126 forks source link

correct computation of timestamp with garmin real time positioning. #1302

Closed tsteven4 closed 1 month ago

tsteven4 commented 1 month ago

Waypoint::SetCreationTime(qint64 t, qint64 ms = 0) arguments are seconds and milliseconds since epoch.

After converting from AM/PM to a 24 hour clock we can see the timestamp is incorrectly computed before this PR (the location has been redacted).

tsteven4@gen1ubuntu22:~/work/noa200links$ date -u ;sudo ./bld/gpsbabel -T -i garmin -f /dev/ttyS0
Sun Jul 21 09:05:42 PM UTC 2024
Sun Jul 21 21:22:22 2024 GMT * * *
Sun Jul 21 21:22:23 2024 GMT * * *
Sun Jul 21 21:22:24 2024 GMT * * *

But after the PR the timestamps are approximately correct:

tsteven4@gen1ubuntu22:~/work/noa200links$ date -u ;sudo ./bld/gpsbabel -T -i garmin -f /dev/ttyS0
Sun Jul 21 09:06:06 PM UTC 2024
Sun Jul 21 21:06:07 2024 GMT * * *
Sun Jul 21 21:06:08 2024 GMT * * *
Sun Jul 21 21:06:09 2024 GMT * * *