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 65F5952BCC for ; Wed, 27 Jul 2005 20:20:32 -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 03559-09 for ; Wed, 27 Jul 2005 23:20:22 +0000 (GMT) Received: from mail.routescape.com (mail.routescape.com [68.167.144.179]) by svr1.postgresql.org (Postfix) with ESMTP id 2DDAC52B7B for ; Wed, 27 Jul 2005 20:20:21 -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 19:20:24 -0400 Message-ID: <6E0907A94904D94B99D7F387E08C4F570732F0@FALCON.INSIGHT> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [JDBC] Date problem on Aix jdk1.4.1 Thread-Index: AcWS/s83/e9gfI1hQA+b53iXUdxlEQAAOaZQ From: "Byron Nikolaidis" To: "Oliver Jowett" Cc: X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.183 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200507/384 X-Sequence-Number: 13532 Here is a really simple test: public class DateTest { public static void main(String[] args) throws Exception { Class.forName("org.postgresql.Driver"); Connection connection =3D DriverManager.getConnection("jdbc:postgresql://host/db"); Statement statement =3D connection.createStatement(); ResultSet rs =3D statement.executeQuery("select id, effective = from date_test"); while(rs.next() ) { Date effective =3D rs.getDate("effective"); int id =3D rs.getInt("id"); System.out.println("id=3D"+id+", effective=3D" + effective.getTime()); } connection.close(); } } Schema Stuff: CREATE TABLE date_test ( effective date, id int2 ) INSERT INTO date_test VALUES ('2005-07-26', 1); INSERT INTO date_test VALUES ('2005-07-26', 2); INSERT INTO date_test VALUES ('2005-07-26', 3); The output results: /usr/java14/bin/java -cp "/usr/insight/postgresql.jar:." DateTest id=3D1, effective=3D1122350400000 <--- correct id=3D2, effective=3D1122354000000 <--- +1 hour id=3D3, effective=3D1122354000000 <--- all same from here out -----Original Message----- From: Oliver Jowett [mailto:oliver@opencloud.com]=20 Sent: Wednesday, July 27, 2005 6:59 PM To: Byron Nikolaidis Cc: pgsql-jdbc@postgresql.org Subject: Re: [JDBC] Date problem on Aix jdk1.4.1 Byron Nikolaidis wrote: > When I query any table with a regular old Date in it, the first row > that comes back is correct (some Date value with 00:00:00 as the time) , > however all subsequent rows are advanced by 1 hour (they have a time of > 01:00:00) . This happens on any table.=20 It's quite weird that it's different on the first row, otherwise I'd say it was a local JVM timezone issue. Do you have some test code we can try? Without knowing what the underlying column's type is or which ResultSet accessor you're using it's just guesswork. -O