[Mapbender-users] WFS-Conf Datepicker: -1 Day?

Jäger, Frank (KRZ) F.Jaeger at KRZ.DE
Fri Feb 8 05:26:30 PST 2013


Hallo,

> and the actual type of the PostgreSQL field

It's just a "date"-field without time.
SQL:
  ALTER TABLE entwurf.objekt ADD COLUMN von date;
  COMMENT ON COLUMN entwurf.objekt.von IS 'Beginn-Datum';


> which timezone is configured in PHP

echo date_default_timezone_get();
Shows: " Europe/Berlin "

PostgreSQL :
/etc/../postgresql.conf was changed now from
  #timezone = unknown # actually, defaults to TZ environment
to
  timezone = 'Europe/Berlin'
whithout any effect.


> might be a timezone configuration problem

My timezone is only 1 h different to UTC. Problems from computing a time from "Berlin" to "UTC" may only appear 1 h +/- around midnight.
But date-Format hasn't any time-component, it's just "year-month-day" which has not to be computed.  


Datepicker puts a string like "2013-02-07" in the textbox of the WFS-Conf.
On the way via GeoServer/WFS to PostGIS it become "2013-02-06" as I can see in pgAdmin.

Reading it back in WFS or WMS-FeatureInfo it is shown as "2013-02-06".
 
Changing WFS-Conf from
  <input data='{\"dateFormat\": \"yy-mm-dd\"}' type='text' id='von' class='hasdatepicker' />
to
  <input data='{\"dateFormat\": \"yyyy-mm-dd\"}' type='text' id='von'  />
For Text-Input without datepicker, doesn't fix the problem.

<input type='text' id='von'  />": save is wrong as before, no read back to textfield.

Last try: Using Datepicker without format.
   <input type='text' id='von' class='hasdatepicker />

Picking "Feb. 7th" puts in WFS-Textbox "02/07/2013".
Save to PostGIS and Feature-Info is "2013-07-02 ".
 Hey!  Month and day are confused, bit NO SHIFT!

Maybe the 
  data='{\"dateFormat\": \"yy-mm-dd\"}' 
is not correct?

I found it on http://www.mapbender.org/Template:WFS_Konfiguration#WFS_Konfigurieren 

Frank


-----Ursprüngliche Nachricht-----
Von: mapbender_users-bounces at lists.osgeo.org [mailto:mapbender_users-bounces at lists.osgeo.org] Im Auftrag von Christian Wygoda
Gesendet: Freitag, 8. Februar 2013 10:11
An: Mapbender User List
Betreff: Re: [Mapbender-users] WFS-Conf Datepicker: -1 Day?

Hi,

might be a timezone configuration problem. Depending on which timezone is configured in PHP and time of day the local time might be in a different day than a datetime without timezone (which is assumed to be UTC, I think).

Just where this problem occurs, is beyond me. I would check PHP's configuration and the actual type of the PostgreSQL field for a beginning.

Cheers,
   Crischan


On 02/07/2013 02:59 PM, Jäger, Frank (KRZ) wrote:
> Hallo,
> first time that I use the Datepicker for Digitize.
>
> PostGIS:
>    von date,
>   
> WFS: GeoServer 2.2
>
> Mapbender 2.7.3, WFS-Conf, HTML-Template:
>   
> <input data='{\"dateFormat\": \"yy-mm-dd\"}' type='text' id='von' 
> class='hasdatepicker' />
>
> See [1] [2]
>
>
> I pick "2013-02-07" in Mapbender-Digitze.
>
> Value in PostGIS and WMS-FeaturInfo show me: "2013-02-06".
>
> Why is it shifted 1 day?
>
> Frank Jäger
>
>
> [1] http://trac.osgeo.org/mapbender/ticket/849
> [2] http://www.mapbender.org/Template:WFS_Konfiguration
>


More information about the Mapbender_users mailing list