Discussion:
[Gpsbabel-code] Bug in KML time stamp reading
Rickey W
2015-06-06 00:14:55 UTC
Permalink
Hi

Thank you guys for your great work on gpsbabel. Really nice program. 

There seems to be a bug with reading KML timezone. After reading the KML <when> XML dateTime element, gpsbabel should calculate the GMT time for formats such as GPX. However, the program seems to only compute the time but not the date. The date is only bumped up when the original dateTime element changes. 

For example, <when>2014-08-26T23:57:24.042-07:00</when> in KML becomes <time>2014-08-26T06:57:24.042Z</time>in GPX, when it in fact should have been <time>2014-08-27T06:57:24.042Z</time>

I've attached a few examples here. 

Thanks 

Rickey
Robert Lipe
2015-06-08 17:49:37 UTC
Permalink
In gpx.cc (yes, that's a bad place for it...) in xml_parse_time(), near the
end you'll find a time = time.addSecs. Try instead replacing that with

// time = time.addSecs(XXX)
dt = QDateTime(as before...)
dt = dt.addSecs(that formula above from XXX)

That stands a much better chance of getting times that span a date right.
Post by Rickey W
Hi
Thank you guys for your great work on gpsbabel. Really nice program.
There seems to be a bug with reading KML timezone. After reading the KML
<when> XML dateTime element, gpsbabel should calculate the GMT time for
formats such as GPX. However, the program seems to only compute the time
but not the date. The date is only bumped up when the original dateTime
element changes.
For example, <when>2014-08-26T23:57:24.042-07:00</when> in KML
becomes <time>2014-08-26T06:57:24.042Z</time>in GPX, when it in fact should
have been <time>2014-08-27T06:57:24.042Z</time>
I've attached a few examples here.
Thanks
Rickey
------------------------------------------------------------------------------
_______________________________________________
Gpsbabel-code mailing list http://www.gpsbabel.org
https://lists.sourceforge.net/lists/listinfo/gpsbabel-code
Loading...