-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DATETIME: Wrong timezone for UTC in attribute table #48393
Comments
Looks like the timezone shown for DateTime fields in the attribute table and the identify features tool is currently the OS timezone and has nothing to do with the data timezone. E.g. for Windows, if you set the OS timzone in the Windows seetings to for the test data provided above the timezone shown in the attribute table and identify feature result is also Hawaii: |
This is really a problem for GeoPackage, as GeoPackage files must have the timestamps as UTC time according to the GeoPackage standard, see also opengeospatial/geopackage#530, especially this comment: opengeospatial/geopackage#530 (comment): […] the OAB recommends that standards conform to the UTC time as specified in both OWS Common and the existing GeoPackage text […] So currently I have the option between
|
Additionally this would work currently only if the UTC-offset matches the OS timzone - so it would be specific for the machine/settings you are using. For different settings and/or machine with different OS timezone, the offset would not match what is displayed in QGIS. |
For reference, related discussions on the QGIS developer mailinglist: |
The test data in the github.com/qgis/QGIS/issues/48393 -- github.com/qgis/QGIS/files/8592150/test_data.zip -- has internal timestamps of 2022-04-13T12:05:23.000Z If those aren't treated as UTC time within QGIS, QGIS is wrong. |
What is the bug or the crash?
Z for Zero timezone (UTC) is ignored, instead local timezone is displayed in attribute table.
Tested for GPKG (type DATETIME) and GeoJSON files and also for a WFS layer:
"timestamp": "2022-04-13T12:05:23Z"
results e.g. in
So in this example the displayed time is wrong by 2 hours.
Steps to reproduce the issue
Versions
master
(cca3562) on Ubuntuand
3.24.2
on WindowsSupported QGIS version
New profile
Additional context
If the layer is exported, e.g. to GeoJSON, the
Z
from the timestamp is missing:Before import::
2022-04-13T12:05:23Z
After export:
2022-04-13T12:05:23
Related SE post:
The text was updated successfully, but these errors were encountered: