X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 0BDA6D830F for ; Fri, 9 Sep 2005 12:11:24 -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 14346-05 for ; Fri, 9 Sep 2005 15:11:21 +0000 (GMT) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by svr1.postgresql.org (Postfix) with ESMTP id 22C59D82BF for ; Fri, 9 Sep 2005 12:11:20 -0300 (ADT) Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11/8.12.11) with ESMTP id j89FBJOB016822 for ; Fri, 9 Sep 2005 11:11:19 -0400 Received: from mail.boston.redhat.com (mail.boston.redhat.com [172.16.76.12]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id j89FBDV30250 for ; Fri, 9 Sep 2005 11:11:13 -0400 Received: from vpn83-172.boston.redhat.com (vpn83-172.boston.redhat.com [172.16.83.172]) by mail.boston.redhat.com (8.12.8/8.12.8) with ESMTP id j89FBDKf005749 for ; Fri, 9 Sep 2005 11:11:13 -0400 From: Vadim Nasardinov Organization: Red Hat (Westford) To: pgsql-jdbc@postgresql.org Subject: Re: Two millisecond timestamp offset Date: Fri, 9 Sep 2005 11:11:39 -0400 User-Agent: KMail/1.8.2 References: <1126264710.3069.76.camel@localhost> In-Reply-To: <1126264710.3069.76.camel@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200509091111.39630.vadimn@redhat.com> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.01 required=5 tests=[AWL=0.010] X-Spam-Level: X-Archive-Number: 200509/31 X-Sequence-Number: 13816 On Friday 09 September 2005 07:18, Adrian Cox wrote: > I couldn't find anything on this with Google, but I've got a 2ms > offset between the java.sql.Timestamp representation and the string > representation of a "timestamp with time zone". > > I've tried the following JDBC releases: 8.1dev-401 JDBC 3, 8.0-312 > JDBC 3, pg74.216.jdbc3.jar. The server is the Debian package Since you're a Debian user, there is a greater-than-zero chance you may be using a free java runtime like GCJ or some such. If so, it would be helpful if you could also mention the version of GCJ that you're using. In old versions of GNU Classpath, the implementation of java.sql.Timestamp was buggy. (It's a little tricky to get right due to the fact that the fractional seconds - the "nanos" - are separate from whole seconds. Care must be taken when converting this slightly schizophrenic internal representation to/from milliseconds.) The only specific bug I remember is this one: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16574 There might have been others.