Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xml dateTimes without timezones should be local, not UTC #1104

Open
tsteven4 opened this issue May 11, 2023 · 5 comments
Open

xml dateTimes without timezones should be local, not UTC #1104

tsteven4 opened this issue May 11, 2023 · 5 comments

Comments

@tsteven4
Copy link
Collaborator

XML Schema Part 2: Datatypes Second Edition 3.2.7 refers to untimezoned dateTime values as "Local".

Correcting this results in 2 test failures. These result from the change in interpretation of untimezoned elements in:

  1. reference/track/fitwrite-track.gpx contains untimezoned time elements.
  2. reference/gc/GC7FA4.gpx contains untimezoned groundspeak:date elements. I don't believe there is a grounspeak schema, so we are only assuming they use the dateTime datatype.
@tsteven4
Copy link
Collaborator Author

While we can patch up xml_parse_time to correct the above issue, we can also consider reducing it to
return QDateTime::fromString(dateTimeString, Qt::ISODateWithMs);
xsd:dateTime is derived from ISO8601, and using the built in Qt ISO conversion is likely sufficient.

@tsteven4
Copy link
Collaborator Author

The 1.1 gpx xsd does have a comment saying times are in UTC and conform to ISO 8601. To conform it would seem to require that the times are timezoned with 'Z', '+00:00', '+0000' or '+00'. The 1.0 gpx xsd does not include this comment.

      Creation/modification timestamp for element. 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.

@robertlipe
Copy link
Collaborator

robertlipe commented May 11, 2023 via email

@tsteven4
Copy link
Collaborator Author

So perhaps we want gpx time elements to be interpreted as UTC if they are untimezoned (as we do). But groundspeak:date elements and other readers (unicsv, xcsv, osm, kml, grtrnctr, html, text) are using xml_parse_time from gpx.cc and getting this unusual behavior. In the case of xcsv replacing the call with QDateTime::fromString(...,Qt::ISODateWithMs) seems in agreement with our documentation for ISO_TIME, ISO_TIME_MS. Our unicsv documentation doesn't even mention that the "date" and "time" keywords can be modified with "iso", but the same substitution seems reasonable. I think html and text are home grown formats and we can do whatever we want. Which leaves osm, kml and gtrnctr.

@GPSBabelDeveloper
Copy link
Collaborator

GPSBabelDeveloper commented May 11, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants