[Geoserver-devel] [JIRA] (GEOS-9509) Incorrect handling of date type when inserting via WFS

Mitchell Bösecke created an issue

GeoServer / BugGEOS-9509

Incorrect handling of date type when inserting via WFS

Issue Type:

BugBug

Affects Versions:

2.15.3

Assignee:

Unassigned

Components:

WFS

Created:

19/Feb/20 6:41 PM

Priority:

MediumMedium

Reporter:

Mitchell Bösecke

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:

  1. 2020-02-19T00:00:00.000-07:00
  2. 2020-02-19T07:00:00.000Z
  3. 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.

Add Comment

Add Comment

Get Jira notifications on your phone! Download the Jira Cloud app for Android or iOS


This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100121-sha1:96a3924)

Atlassian logo