X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 3880152B16 for ; Wed, 27 Jul 2005 21:08:40 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 15044-04 for ; Thu, 28 Jul 2005 00:08:30 +0000 (GMT) Received: from mail.routescape.com (mail.routescape.com [68.167.144.179]) by svr1.postgresql.org (Postfix) with ESMTP id 815FC528A3 for ; Wed, 27 Jul 2005 21:08:28 -0300 (ADT) Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 Subject: Re: Date problem on Aix jdk1.4.1 Date: Wed, 27 Jul 2005 20:08:32 -0400 Message-ID: <6E0907A94904D94B99D7F387E08C4F570732F1@FALCON.INSIGHT> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [JDBC] Date problem on Aix jdk1.4.1 Thread-Index: AcWTBCAaxoDjcWVWTmKRriY+FcTKQAAAH8cw From: "Byron Nikolaidis" To: "Oliver Jowett" Cc: X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.137 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200507/386 X-Sequence-Number: 13534 Timezone on AIX box is EDT (you can see Calendar below too). =20 As for the Calendar output, the values on AIX between rows is identical (except for the time=3D1122350400000). To compare AIX and Windows, = I see a single difference: on Windows the DAY_OF_YEAR=3D365 compared with AIX DAY_OF_YEAR=3D?, 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=3D1122350400000,areFieldsSet=3Dfalse,are= All FieldsSet=3Dtrue,lenient=3Dtrue,zone=3Dsun.util.calendar.ZoneInfo[id=3D"A= merica/ New_York",offset=3D-18000000,dstSavings=3D3600000,useDaylight=3Dtrue,tran= sitio ns=3D139,lastRule=3Djava.util.SimpleTimeZone[id=3DAmerica/New_York,offset= =3D-180 00000,dstSavings=3D3600000,useDaylight=3Dtrue,startYear=3D0,startMode=3D3= ,startM onth=3D3,startDay=3D1,startDayOfWeek=3D1,startTime=3D7200000,startTimeMod= e=3D0,end Mode=3D2,endMonth=3D9,endDay=3D-1,endDayOfWeek=3D1,endTime=3D7200000,endT= imeMode=3D0 ]],firstDayOfWeek=3D1,minimalDaysInFirstWeek=3D1,ERA=3D1,YEAR=3D2005,MONT= H=3D6,WEE K_OF_YEAR=3D1,WEEK_OF_MONTH=3D5,DAY_OF_MONTH=3D26,DAY_OF_YEAR=3D?,DAY_OF_= WEEK=3D4, DAY_OF_WEEK_IN_MONTH=3D5,AM_PM=3D1,HOUR=3D7,HOUR_OF_DAY=3D0,MINUTE=3D0,SE= COND=3D0,MI LLISECOND=3D0,ZONE_OFFSET=3D-18000000,DST_OFFSET=3D0] Windows: (using jdk1.4.1_07) Calendar: id#1 calendar: java.util.GregorianCalendar[time=3D1122350400000,areFieldsSet=3Dfalse,are= All FieldsSet=3Dtrue,lenient=3Dtrue,zone=3Dsun.util.calendar.ZoneInfo[id=3D"A= merica/ New_York",offset=3D-18000000,dstSavings=3D3600000,useDaylight=3Dtrue,tran= sitio ns=3D235,lastRule=3Djava.util.SimpleTimeZone[id=3DAmerica/New_York,offset= =3D-180 00000,dstSavings=3D3600000,useDaylight=3Dtrue,startYear=3D0,startMode=3D3= ,startM onth=3D3,startDay=3D1,startDayOfWeek=3D1,startTime=3D7200000,startTimeMod= e=3D0,end Mode=3D2,endMonth=3D9,endDay=3D-1,endDayOfWeek=3D1,endTime=3D7200000,endT= imeMode=3D0 ]],firstDayOfWeek=3D1,minimalDaysInFirstWeek=3D1,ERA=3D1,YEAR=3D2005,MONT= H=3D6,WEE K_OF_YEAR=3D1,WEEK_OF_MONTH=3D5,DAY_OF_MONTH=3D26,DAY_OF_YEAR=3D365,DAY_O= F_WEEK=3D 4,DAY_OF_WEEK_IN_MONTH=3D5,AM_PM=3D1,HOUR=3D7,HOUR_OF_DAY=3D0,MINUTE=3D0,= SECOND=3D0, MILLISECOND=3D0,ZONE_OFFSET=3D-18000000,DST_OFFSET=3D0] -----Original Message----- From: Oliver Jowett [mailto:oliver@opencloud.com]=20 Sent: Wednesday, July 27, 2005 7:37 PM To: Byron Nikolaidis Cc: pgsql-jdbc@postgresql.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 >=20 > id=3D1, effective=3D1122350400000 <--- correct > id=3D2, effective=3D1122354000000 <--- +1 hour > id=3D3, effective=3D1122354000000 <--- all same from here out It seems ok under 1.4.2 on Linux, with driver build 310, in NZST: id=3D1, effective=3D1122292800000 id=3D2, effective=3D1122292800000 id=3D3, effective=3D1122292800000 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