Re: Date problem on Aix jdk1.4.1

From: "Byron Nikolaidis" <ByronN(at)Routescape(dot)com>
To: "Oliver Jowett" <oliver(at)opencloud(dot)com>
Cc: <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Date problem on Aix jdk1.4.1
Date: 2005-07-28 00:08:32
Message-ID: 6E0907A94904D94B99D7F387E08C4F570732F1@FALCON.INSIGHT
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc


Timezone on AIX box is EDT (you can see Calendar below too).

As for the Calendar output, the values on AIX between rows is identical
(except for the time=1122350400000). To compare AIX and Windows, I
see a single difference: on Windows the DAY_OF_YEAR=365 compared with
AIX DAY_OF_YEAR=?, not sure if that means anything?

Can anybody run this test on Aix 5.3, either to confirm they get the
same behavior, or use Java 1.4.2 and verify everything works fine?

AIX:

calendar: id#1
java.util.GregorianCalendar[time=1122350400000,areFieldsSet=false,areAll
FieldsSet=true,lenient=true,zone=sun.util.calendar.ZoneInfo[id="America/
New_York",offset=-18000000,dstSavings=3600000,useDaylight=true,transitio
ns=139,lastRule=java.util.SimpleTimeZone[id=America/New_York,offset=-180
00000,dstSavings=3600000,useDaylight=true,startYear=0,startMode=3,startM
onth=3,startDay=1,startDayOfWeek=1,startTime=7200000,startTimeMode=0,end
Mode=2,endMonth=9,endDay=-1,endDayOfWeek=1,endTime=7200000,endTimeMode=0
]],firstDayOfWeek=1,minimalDaysInFirstWeek=1,ERA=1,YEAR=2005,MONTH=6,WEE
K_OF_YEAR=1,WEEK_OF_MONTH=5,DAY_OF_MONTH=26,DAY_OF_YEAR=?,DAY_OF_WEEK=4,
DAY_OF_WEEK_IN_MONTH=5,AM_PM=1,HOUR=7,HOUR_OF_DAY=0,MINUTE=0,SECOND=0,MI
LLISECOND=0,ZONE_OFFSET=-18000000,DST_OFFSET=0]

Windows: (using jdk1.4.1_07)

Calendar: id#1
calendar:
java.util.GregorianCalendar[time=1122350400000,areFieldsSet=false,areAll
FieldsSet=true,lenient=true,zone=sun.util.calendar.ZoneInfo[id="America/
New_York",offset=-18000000,dstSavings=3600000,useDaylight=true,transitio
ns=235,lastRule=java.util.SimpleTimeZone[id=America/New_York,offset=-180
00000,dstSavings=3600000,useDaylight=true,startYear=0,startMode=3,startM
onth=3,startDay=1,startDayOfWeek=1,startTime=7200000,startTimeMode=0,end
Mode=2,endMonth=9,endDay=-1,endDayOfWeek=1,endTime=7200000,endTimeMode=0
]],firstDayOfWeek=1,minimalDaysInFirstWeek=1,ERA=1,YEAR=2005,MONTH=6,WEE
K_OF_YEAR=1,WEEK_OF_MONTH=5,DAY_OF_MONTH=26,DAY_OF_YEAR=365,DAY_OF_WEEK=
4,DAY_OF_WEEK_IN_MONTH=5,AM_PM=1,HOUR=7,HOUR_OF_DAY=0,MINUTE=0,SECOND=0,
MILLISECOND=0,ZONE_OFFSET=-18000000,DST_OFFSET=0]

-----Original Message-----
From: Oliver Jowett [mailto:oliver(at)opencloud(dot)com]
Sent: Wednesday, July 27, 2005 7:37 PM
To: Byron Nikolaidis
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: [JDBC] Date problem on Aix jdk1.4.1

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

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Oliver Jowett 2005-07-28 00:24:16 Re: Date problem on Aix jdk1.4.1
Previous Message Oliver Jowett 2005-07-27 23:37:15 Re: Date problem on Aix jdk1.4.1