Re: pgdev.305.jdbc3, postgresql 8.0 and timestamps

From: Kris Jurka <books(at)ejurka(dot)com>
To: Mario Ivankovits <imario(at)apache(dot)org>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: pgdev.305.jdbc3, postgresql 8.0 and timestamps
Date: 2004-08-19 03:51:43
Message-ID: Pine.BSO.4.56.0408182244370.29626@leary.csoft.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message jpicard 2004-08-19 09:32:20 Error on connection
Previous Message Dave Cramer 2004-08-18 19:51:34 Re: pgdev.305.jdbc3, postgresql 8.0 and timestamps