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 D5F53D6E26 for ; Fri, 9 Sep 2005 12:03:54 -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 12443-05 for ; Fri, 9 Sep 2005 15:03:38 +0000 (GMT) Received: from mail.humboldt.co.uk (mail.humboldt.co.uk [81.2.65.18]) by svr1.postgresql.org (Postfix) with ESMTP id 6DE06D844A for ; Fri, 9 Sep 2005 12:03:37 -0300 (ADT) Received: from newt.humboldt.co.uk ([81.2.65.19] helo=[192.168.78.155]) by mail.humboldt.co.uk with asmtp (Exim 3.35 #1 (Debian)) id 1EDkPX-0002wO-00; Fri, 09 Sep 2005 16:03:27 +0100 Subject: Re: Two millisecond timestamp offset From: Adrian Cox To: Oliver Jowett Cc: pgsql-jdbc@postgresql.org In-Reply-To: <43219B60.2050706@opencloud.com> References: <1126264710.3069.76.camel@localhost> <43219B60.2050706@opencloud.com> Content-Type: text/plain Date: Fri, 09 Sep 2005 16:03:25 +0100 Message-Id: <1126278205.3069.102.camel@localhost> Mime-Version: 1.0 X-Mailer: Evolution 2.2.2 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 required=5 tests=[none] X-Spam-Level: X-Archive-Number: 200509/30 X-Sequence-Number: 13815 On Sat, 2005-09-10 at 02:25 +1200, Oliver Jowett wrote: > The JDBC driver will use the JVM's default timezone to format dates > unless you explicitly pass a Calendar to setTimestamp() etc, so if that > timezone is mysteriously 2ms out then it'd explain the strange behaviour > you see. Thanks for the clue. There was an error in the code that built the shared SimpleTimeZone object used for all the date calculations. It was cut and pasted in from some broken reference code: new SimpleTimeZone(SimpleTimeZone.UTC_TIME, "UTC"); The value of SimpleTimeZone.UTC_TIME is actually 2, leading to a mysterious two millisecond offset. -- Adrian Cox