From: tsteven4 <13596209+tsteven4@users.noreply.github.com> Date: Fri, 12 May 2023 15:48:24 +0000 (-0600) Subject: restrict osm timestamps. (#1107) X-Git-Tag: archive/raspbian/1.10.0+ds-2+rpi1~1^2~12^2~1^2~60 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=7b21b453ccaafd87f920b2fd39d2d8cf03026c09;p=gpsbabel.git restrict osm timestamps. (#1107) osm consumers may not accept fractional seconds, but all should support whole seconds. osm consumers may not accept time zone designations other than Z, but all should support time zone designation Z. See https://github.com/osmcode/osmium-tool/issues/267 --- diff --git a/osm.cc b/osm.cc index 91365ef95..1409cc831 100644 --- a/osm.cc +++ b/osm.cc @@ -718,7 +718,8 @@ OsmFormat::osm_waypt_disp(const Waypoint* waypoint) fout->writeAttribute(QStringLiteral("lat"), QString::number(waypoint->latitude, 'f', 7)); fout->writeAttribute(QStringLiteral("lon"), QString::number(waypoint->longitude, 'f', 7)); if (waypoint->creation_time.isValid()) { - fout->writeAttribute(QStringLiteral("timestamp"), waypoint->CreationTimeXML()); + // osm readers don't uniformally support fractional seconds, and may only accept time zone designation Z. + fout->writeAttribute(QStringLiteral("timestamp"), waypoint->creation_time.toUTC().toString(Qt::ISODate)); } if (waypoint->hdop) {