8

I use this solution to display actual QDateTime value with milliseconds in a temporary memory layer. And I use another solution to export as CSV the value including the millisecond value.

enter image description here

But then, I realized that "Use Date/Time" option changed the type of the time_break field from QDateTime to string when I exported as GeoPackage. But I need a datetime field in the GeoPackage.

Export using "Use Date/Time" option:

enter image description here

Result (converted to string):

enter image description here

If I don't use "Use Date/Time" option, it exports the field as QDateTime, but it changes all millisecond values to zero:

enter image description here

How can I export it as a GeoPackage to contain the datetime field with the actual millisecond value?

2
  • Maybe there is a bug? I did not find any way to save this GeoJSON into a new geopackage and keep the fractional seconds. Same thing is I first converted json into geopackage with ogr2ogr that does keep fractional seconds { "type": "FeatureCollection", "name": "timestamp", "features": [ { "type": "Feature", "properties": { "id": "1", "timestamp": "2022-05-20T01:02:03.456+01:00" }, "geometry": { "type": "Point", "coordinates": [ 47224.476043935123016, 5282390.128387222066522 ] } } ]}
    – user30184
    Commented May 30, 2022 at 18:27
  • 1
    Maybe there is some analogy with this github.com/qgis/QGIS/pull/41213 where the fix was to use Qt::ISODateWithMs.
    – user30184
    Commented May 30, 2022 at 18:47

0

Browse other questions tagged or ask your own question.