Re: Date problem on Aix jdk1.4.1 - Mailing list pgsql-jdbc

From Oliver Jowett
Subject Re: Date problem on Aix jdk1.4.1
Date
Msg-id 42E81AAB.8030005@opencloud.com
Whole thread Raw
In response to Re: Date problem on Aix jdk1.4.1  ("Byron Nikolaidis" <ByronN@Routescape.com>)
List pgsql-jdbc
Byron Nikolaidis wrote:
> Here is a really simple test:

> /usr/java14/bin/java -cp "/usr/insight/postgresql.jar:." DateTest
>
> id=1, effective=1122350400000    <---  correct
> id=2, effective=1122354000000    <---   +1 hour
> id=3, effective=1122354000000    <---   all same from here out

It seems ok under 1.4.2 on Linux, with driver build 310, in NZST:

id=1, effective=1122292800000
id=2, effective=1122292800000
id=3, effective=1122292800000

What timezone is the AIX box in exactly? Can you try a 1.4.2 JVM on there?

The only thing I can think of is some sort of Calendar modification
caused by the first getDate() is carrying over to subsequent calls (the
calendar used is shared between calls), but given that the only thing
that code really touches is the zone/dst offsets, and they're reset each
time, I'm not sure what exactly it would be.

You could try putting something like

  System.err.println("calendar: " + cal);

in org.postgresql.jdbc2.TimestampUtils.toDate() around line 253, just
before the return, and see if there are any notable differences between
the first and second calls..

-O

pgsql-jdbc by date:

Previous
From: "Byron Nikolaidis"
Date:
Subject: Re: Date problem on Aix jdk1.4.1
Next
From: "Byron Nikolaidis"
Date:
Subject: Re: Date problem on Aix jdk1.4.1