qgis - QField DateTime field does not retain time on submit - Stack Overflow

admin2025-04-24  2

I have a field for a layer in QGIS that is a Date/Time widget type. I want to save date time automatically with custom format yyyy-MM-ddTHH:mm:ss. Default value set to now(). The project is packaged for QField with QFieldSync.

When setting a point on the tablet (Samsung Active 4) the Date/Time at first appear, although the time is ~6 hours ahead. After submitting the date is retained but time reads all zeros.

I have spent too much time on this problem and have yet to discover how to format this field correctly. I would be grateful for any help.

Field formatted in QGIS

Entering a new point in QField, the time appears but is several hours ahead

Editing the point in QField, the date is retained but time is all zeros

I have a field for a layer in QGIS that is a Date/Time widget type. I want to save date time automatically with custom format yyyy-MM-ddTHH:mm:ss. Default value set to now(). The project is packaged for QField with QFieldSync.

When setting a point on the tablet (Samsung Active 4) the Date/Time at first appear, although the time is ~6 hours ahead. After submitting the date is retained but time reads all zeros.

I have spent too much time on this problem and have yet to discover how to format this field correctly. I would be grateful for any help.

Field formatted in QGIS

Entering a new point in QField, the time appears but is several hours ahead

Editing the point in QField, the date is retained but time is all zeros

Share Improve this question edited Jan 17 at 22:21 devitti asked Jan 17 at 21:15 devittidevitti 52 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

I detected exactly the same behavior as you described above. My solution was checking the field type again and enusre your field type is DateTime instead of Date. Now your time can be stored as well.

Unfortunately, you cannot change the type of a field within the existing layer. You can either create a new field or change the field type with the function refactor fields.

转载请注明原文地址:http://anycun.com/QandA/1745456429a90687.html