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 67D48D82FF for ; Fri, 9 Sep 2005 11:25:36 -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 02473-05 for ; Fri, 9 Sep 2005 14:25:32 +0000 (GMT) Received: from yass.opencloud.co.nz (yass.opencloud.co.nz [203.79.85.162]) by svr1.postgresql.org (Postfix) with ESMTP id 9D3A5D82BF for ; Fri, 9 Sep 2005 11:25:33 -0300 (ADT) Received: from 203-79-104-60.cable.paradise.net.nz ([203.79.104.60] helo=[192.168.0.20]) by yass.opencloud.co.nz with asmtp (TLS-1.0:DHE_RSA_AES_128_CBC_SHA:16) (Exim 4.34) id 1EDjou-0007BQ-KX; Sat, 10 Sep 2005 02:25:36 +1200 Message-ID: <43219B60.2050706@opencloud.com> Date: Sat, 10 Sep 2005 02:25:36 +1200 From: Oliver Jowett User-Agent: Mozilla Thunderbird 1.0.2 (X11/20050324) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Adrian Cox Cc: pgsql-jdbc@postgresql.org Subject: Re: Two millisecond timestamp offset References: <1126264710.3069.76.camel@localhost> In-Reply-To: <1126264710.3069.76.camel@localhost> X-Enigmail-Version: 0.90.2.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.008 required=5 tests=[AWL=0.008] X-Spam-Level: X-Archive-Number: 200509/29 X-Sequence-Number: 13814 Adrian Cox wrote: > The output from Java code is: > Result 1 :- 2005-05-12 17:14:21.000 > Result 2 :- 2004-11-10 17:32:19.002 > > The database sees: > testcode=> select * from test; > index | datetime > -------+---------------------------- > 1 | 2005-05-12 17:14:20.998+00 > 2 | 2004-11-10 17:32:19+00 > (2 rows) This works correctly on my system, so there is something else going on here. What is the JVM's default timezone? If you format the Date objects using that timezone, what do you get? 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. -O