I imported a WFS layer from a geoserver into QGIS and also into a web service that is based on Cesium. The geoserver fetches the data from Elastic search and serves it out as WFS. The date-time attribute of the data stored in Elastic Search is in UTC. The web service (based on Cesium) displays the date-time attribute in UTC, but QGIS displays the same date-time attribute my local time zone. My local time zone is GMT minus 5 hours.

Example: A date-time attribute is stored in Elastic Search as ‘2017-12-29 01:10:37.000Z’. The web service displays the date-time as ‘2017-12-29T01:10:37Z’. The QGIS Identify Results and the QGIS attribute table both display the date-time as ‘2017-12-28T20:10:37’

Including a ‘Z’ in the SQL filter doesn’t seem to make any difference and provides misleading results. In QGIS, the layer filter date-time = ‘2017-12-28 20:10:37.000Z’ finds the feature, but date-time = ‘2017-12-29 01:10:37.000Z’ does not find the feature.

It seems QGIS is converting the date-time attribute to local time. I can’t find a preference to override QGIS converting date-time values. I want the results to be displayed in UTC, not local. Is there a way to do that in QGIS?

  • 1
    Have you checked the raw output from GeoServer to be sure that it does not change the times? – user30184 Apr 27 '18 at 18:50
  • Just checked. Queried GML shows UTC time coming from the geoserver. – slalomchip May 1 '18 at 16:42
  • What happens if you save the GML from the server into a file and open that with QGIS? Is it still changing the time to local? – user30184 May 3 '18 at 5:43
  • Sorry for the delay. I made http calls to the geoserver for the exact same feature and requested returns to be in different formats: GML3, CSV, and JSON. All three returned UTC date-times. In QGIS, the same feature, when viewed in the "Identify Results" panel shows the date-time in local time instead of UTC time. I want UTC time instead of local time. – slalomchip May 10 '18 at 17:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.