Monday, 8 February 2016

GeoServer converting PostGIS timestamp with time zone


In a PostGIS view i have a field of data type "timestamp with time zone". In GeoServer this field is show with datatype "Timestamp" enter image description here


My problem is that i want the Timestamp to be show in my application exactly as it is in my Database as UTM. +00.


What i get back from GeoServer via WFS request is:



2010-08-20T16:56:15.095-04:00



What is stored in the PostGIS database is:




2010-08-20 20:56:15.095+00



How do i tell GeoServer not to convert the time so that i see the time exactly how it is in the database as UTM? Is it on Apache, System Time, GeoServer config?


Running GeoServer on latest stable Suse linux Ent.



Answer



The only way I can think of is to change the default timezone on your server so that it is UTM+00. When the postgres jdbc driver gets the date from the server it will parse it into a Date object, which will by default display it in the default timezone. And there is no way with GeoServer wfs to supply a custom format for date output in GML.


You can try setting the timezone with the jvm system property: -Duser.timezone=GMT.


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...