UTC imported as UTC but subsequently reported as a local time zone when reopened #56695
Open
2 tasks done
Labels
Bug
Either a bug report, or a bug fix. Let's hope for the latter!
What is the bug or the crash?
Issue: When a CSV file is imported into QGIS with a date time column formatted following ISO 8600 including the addition of Zulu time, it is properly identified a UTC in the metadata. When exported as a GeoPackage and then reopened the time column will be expressed using the time zone value for the operating system of the computer. Note this time is not adjusted to the time zone of the computer it is reported as in the time zone of the computer. Thus 14:00:00 UTC will be 14:00:00 EST (or whatever the cpu time zone is).
Steps to reproduce the issue
Versions
This bug seems to impact all versions of QGIS that I've worked with, and there are many threads that discuss time stamps including that this is a 'default' behaviour. However, to be version specific the bug can be reproduced on:
QGIS version 3.28.15-Firenze
QGIS code revision 252ad49ddcb
Qt version 5.15.2
Python version 3.9.5
GDAL/OGR version 3.3.2
PROJ version 8.1.1
EPSG Registry database version v10.028 (2021-07-07)
GEOS version 3.9.1-CAPI-1.14.2
SQLite version 3.35.2
PDAL version 2.3.0
PostgreSQL client version unknown
SpatiaLite version 5.0.1
QWT version 6.1.6
QScintilla2 version 2.11.5
OS version macOS 13.6
Supported QGIS version
New profile
Additional context
Note this bug is not about 'enabling time zone support' or adding time UTC offsets to the program code, it is that QGIS is misreporting time zonse. To fix it does not require time zones be adjusted (that would require time zone support), only that the zone information be left alone. If the system has already recognized it as UTC then save it as such. If the zone is not UTC (and QGIS doesn't support it - which is basically all zones) the user should be warned that the zone is not supported and then the zone should be set to 'unsupported' or whatever NOT the zone for the operating system. Alternatively, ALL time zones should be reported as NA if QGIS lacks the ability to properly save a UTC time stamp as UTC in a GeoPackage. This is a bug and not a request because QGIS is fundamentally changing time stamp values by misrepresenting the zone (also called lying) by adding zone information to files based on the geolocation of a computer. It is equivalent to QGIS taking a WGS84 lat long layer and assigning a CRS of UTM Zone (insert zone here based on computer geolocation) while leaving the actual coordinates as decimal degrees and reporting it is UTM!
The text was updated successfully, but these errors were encountered: