Bug report #14163
processing: datetime fields converted to date (time data loss) when saved to memory layer
Status: | Closed | ||
---|---|---|---|
Priority: | Normal | ||
Assignee: | Victor Olaya | ||
Category: | Processing/Core | ||
Affected QGIS version: | master | Regression?: | No |
Operating System: | Easy fix?: | No | |
Pull Request or Patch supplied: | No | Resolution: | |
Crashes QGIS or corrupts data: | No | Copied to github as #: | 22165 |
Description
Applying an algorithm to a layer which contains a datetime field will result in an ouput that transforms the datetime field into a date-only field, causing time data loss. While a shapefile only supports date field, the memory layer does (as soon as https://github.com/qgis/QGIS/pull/2713 is merged) support datetime field, it'd be nice for processing to preserve datetime when the output if a memory layer.
Associated revisions
[processing] add date, datetime, time fields to memory output
(fixes #14163)
History
#1 Updated by Alexander Bruy almost 9 years ago
Processing copies fields definition from source layers, so If layer reports field as DateTime and output format/provider supports this data type without conversion it should just work
#2 Updated by Mathieu Pellerin - nIRV almost 9 years ago
- File test.gpx added
Alex, it does not over here :) Here's an easy set of steps to reproduce the loss of datetime field:
- Create a new project
- Add the attached test.gpx vector file (choose the track_points layer)
- Open the layer properties window, and take note of the "time" field, identified as a DateTime field type
- Open processing, and select the "Fixed distance buffer" algorithm
- Save the resulting buffer to a memory layer
- Open the layer properties window for the newly created buffer memory layer, and take note of the "time" field, converted to a String field type
#3 Updated by Mathieu Pellerin - nIRV almost 9 years ago
- Status changed from Open to Closed
Fixed in changeset 427b9c97341d802b7056fef68eb60816994cd54a.