| Using WFS, I insert a new record with a desired date of "2020-02-19" but it persists "2020-02-18" into the database. My column is in a postgresql database and is of type "date". My database and OS are configured to use the MST timezone (-7). Sending any of these values to geoserver via WFS results in the undesired outcome:
- 2020-02-19T00:00:00.000-07:00
- 2020-02-19T07:00:00.000Z
- 2020-02-19
Applying "org.geotools.localDateTimeHandling" does not resolve or even change the outcome. I can confirm the hint is being applied properly because a GetFeatureInfo request changes it's response from "2020-02-18Z" to "2020-02-18". It almost appears to affect reading data but not writing data. If I use the type "timestamp without time zone" in my postgresql database, I get the expected/desired outcome, i.e. it works correctly. If I was to guess as to what's happening, I suspect the the input date "2020-02-19T07:00:00.000Z" first gets truncated (because the database column doesn't store a time) to "2020-02-19" and then it undergoes a UTC->MST conversion, ultimately becoming "2020-02-18". If it converted the timezone FIRST and then removed the time, I suspect it would have the desired outcome. |