The GeoTools/GeoServer data handler should use the timezone of the server
(so if that is set to GMT then you need to convert before sending). This
allows for servers where clients can be in multiple timezones and need to
agree a fixed timezone when communicating with the server.
If you are the only user of the client/server then you should be able to
set the timezone on the server and client to the same one and it should all
just work (tm).
Ian
On 13 October 2016 at 14:33, Walter Stovall <walter.stov...@byers.com>
wrote:
> Using GeoServer2.8 I’m having a very basic problem with WFS-T inserting a
> feature that has date fields. When I do a GetFeature to retrieve the date
> I inserted, I get a value that’s one-day prior to the date I inserted.
> This appears to be related to the GeoTools xsDateTimeFormat class used to
> read the incoming XML on my insert-request and the code’s assumption that
> the incoming date is in the GMT timezone. Do clients of WFS have to
> convert all their dates to GMT before inserting them??
>
>
>
> Here is an example transaction that I use for insert…
>
> <?xml version="1.0" encoding="UTF-8"?>
>
> <Transaction
>
> xmlns="http://www.opengis.net/wfs"
>
> xmlns:gml="http://www.opengis.net/gml"
>
> xmlns:ogc="http://www.opengis.net/ogc"
>
> version="1.0.0"
>
> service="WFS">
>
> <Insert>
>
> <LAYER1 fid="none">
>
> <INSTALLED_DATE>2016-01-04</INSTALLED_DATE>
>
> </LAYER1>
>
> </Insert>
>
> </Transaction>
>
>
>
> Then I read it back with…
>
> <?xml version="1.0" encoding="UTF-8"?>
>
> <GetFeature
>
> xmlns="http://www.opengis.net/wfs"
>
> xmlns:fdot="http://byers.com/nxwx/solution/fdot"
>
> xmlns:gml="http://www.opengis.net/gml"
>
> xmlns:ogc="http://www.opengis.net/ogc"
>
> version="1.0.0"
>
> service="WFS"
>
> outputFormat="JSON">
>
> <Query typeName="LAYER1">
>
> <ogc:Filter>
>
> <ogc:FeatureId fid="LAYER1.7649040"/>
>
> </ogc:Filter>
>
> </Query>
>
> </GetFeature>
>
>
>
> In the JSON output I find…
>
> "INSTALLED_DATE":"2016-01-03Z"
>
>
>
> So I stored 1/4/2016, I read back 1/3/2016.
>
>
>
> My back-end datastore is Oracle. When I select directly from the database
> I find the wrong value there too.
>
> SELECT TO_CHAR(installed_date, 'dd-mon-yyyy hh24:mi:ss')…
>
>
>
> This gives me… 03-jan-2016 19:00:00.
>
>
>
> How do I set things up so a WFS client that stores 1/4/2016 gets 1/4/2016
> back?
>
> ------------------------------------------------------------
> ------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> _______________________________________________
> Geoserver-users mailing list
> Geoserver-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geoserver-users
>
>
--
Ian Turton
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users