Re: pgdev.305.jdbc3, postgresql 8.0 and timestamps - Mailing list pgsql-jdbc

From Kris Jurka
Subject Re: pgdev.305.jdbc3, postgresql 8.0 and timestamps
Date
Msg-id Pine.BSO.4.56.0408182244370.29626@leary.csoft.net
Whole thread Raw
In response to pgdev.305.jdbc3, postgresql 8.0 and timestamps  (Mario Ivankovits <imario@apache.org>)
List pgsql-jdbc

On Wed, 18 Aug 2004, Mario Ivankovits wrote:

> Hello !
>
> I have a problem with the pgdev.305.jdbc3 driver and timestamps.
>
> I created a simple table where the primary key is a timestamp field.
> Then i inserted a row with the timestamp: 2004-08-17 21:00:00
> If i select the record using this date 2004-08-17 21:00:00 it will
> return the correct row, but a getTimestamp on this row will
> report 2004-08-17 19:00:00 instead of 2004-08-17 21:00:00.
> The timestamp in the database shows 2004-08-17 19:00:00.
> So there is a timezone discrepance between the data sent to the database
> and the data read back from it.
>

I have not been able to duplicate this problem.  What server version are
you running this against?  Is there something else unusual in your setup?
Does the java client believe it is in a different timezone than the
database?  Compare SELECT now() in psql versus
System.out.println(new java.text.SimpleDateFormat("Z").format(new Date()))

Kris Jurka


pgsql-jdbc by date:

Previous
From: Lane Sharman
Date:
Subject: Re: Advice
Next
From: jpicard@free.fr
Date:
Subject: Error on connection