Re: Calendar vs. Timestamp

Lists: pgsql-jdbc
From: "Wei Wei" <wei725(at)lycos(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Calendar vs. Timestamp
Date: 2006-04-11 17:28:44
Message-ID: 20060411172844.7305786B12@ws7-1.us4.outblaze.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-jdbc

I move this issue from the general mailing list. Here is my problem:

In the Java application, I create a Calendar object and the getTime and getTimeZone return the following values:

* Sun Apr 09 12:40:52 PDT 2006
* Pacific Standard Time

The Calendar object is matched to the timestamp with time zone data type throught Hibernate. And the above data is stored as the following:

2006-04-09 14:40:53.093-07

That is not correct. The command of "select now()" returns a correct value. The PG version is 8.0.x and the jdbc version is 8.0.309.jdbc3. Is it a bug in the driver?

Thanks.

--
_______________________________________________

Search for businesses by name, location, or phone number. -Lycos Yellow Pages

http://r.lycos.com/r/yp_emailfooter/http://yellowpages.lycos.com/default.asp?SRC=lycos10


From: Kris Jurka <books(at)ejurka(dot)com>
To: Wei Wei <wei725(at)lycos(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Calendar vs. Timestamp
Date: 2006-04-11 20:08:23
Message-ID: Pine.BSO.4.63.0604111506420.17492@leary2.csoft.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-jdbc

On Tue, 11 Apr 2006, Wei Wei wrote:

> I move this issue from the general mailing list. Here is my problem:
>
> In the Java application, I create a Calendar object and the getTime and
> getTimeZone return the following values:
>
> * Sun Apr 09 12:40:52 PDT 2006
> * Pacific Standard Time
>
> The Calendar object is matched to the timestamp with time zone data type
> throught Hibernate. And the above data is stored as the following:
>
> 2006-04-09 14:40:53.093-07
>
> That is not correct. The command of "select now()" returns a correct
> value. The PG version is 8.0.x and the jdbc version is 8.0.309.jdbc3. Is
> it a bug in the driver?
>

The 8.1 driver has better timezone/calendar support. Please try the
latest 8.1 release and if that doesn't fix your problem, send us the java
code to reproduce your problem.

Kris Jurka