Hi,
I’m just trying to track down how geoserver is handling time zones. Here’s an example (I’ve used postgis);
create table date_test(fid integer primary key, geom geometry, date timestamp with time zone, tag text);
CREATE TABLE
postgis=# insert into date_test values (1,‘POINT(0 0)’::geometry, ‘2001-01-01 01:01:01Z’, ‘one’);
INSERT 0 1
postgis=# select * from date_test ;
fid | geom | date | tag
-----±-------------------------------------------±-----------------------±----
1 | 010100000000000000000000000000000000000000 | 2000-12-31 17:01:01-08 | one
(1 row)
You can see, it’s taken the GMT time and showing it in local time (-8 for me), but the value is correct.
When I publish in geoserver, it sets the type of the column as Timestamp.
From layer page;
date | Timestamp | true | 0/1 |
---|
From DescribeFeatureType;
<xsd:element maxOccurs=“1” minOccurs=“0” name=“date” nillable=“true” type=“xsd:dateTime”/>
Here’s the GetFeature (1.0) response;
test:date2000-12-31T17:01:01</test:date>
You can see its giving the date back in local (PST) time, but there’s no indication that this is what’s happening.
Looking around, I’m seeing “Time zones that aren’t specified are considered undetermined.”
I’ve also found that if I mess with the timezone on my computer, I get different values back.
I think the WFS should be converting the Timestamp so it ends up with a timezone in the GetFeature results.
Thanks,
Dave
PS. I noticed this problem while looking at GeoGIG, which handles Timestamps similarly.