Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id A406D9FB5BE for ; Mon, 23 Jul 2007 19:30:34 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 97502-04 for ; Mon, 23 Jul 2007 19:30:27 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from tremor.opencloud.co.nz (tremor.opencloud.co.nz [131.203.101.230]) by postgresql.org (Postfix) with ESMTP id 15DC59FB564 for ; Mon, 23 Jul 2007 19:30:30 -0300 (ADT) Received: from 222-154-149-187.jetstream.xtra.co.nz ([222.154.149.187] helo=[10.1.1.3]) by tremor.opencloud.co.nz with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1ID6Q5-0006NX-Gc; Tue, 24 Jul 2007 10:30:25 +1200 Message-ID: <46A52C0B.7070608@opencloud.com> Date: Tue, 24 Jul 2007 10:30:35 +1200 From: Oliver Jowett User-Agent: Thunderbird 1.5.0.12 (Windows/20070509) MIME-Version: 1.0 To: Mikko Tiihonen CC: pgsql-jdbc Subject: Re: Make time/timestamp tests fair for binary transfers References: <1185213747.1632.116.camel@dual.local> In-Reply-To: <1185213747.1632.116.camel@dual.local> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200707/107 X-Sequence-Number: 17281 Mikko Tiihonen wrote: > The patch also alters what kind of java.sql.Time values are returned. > Before the patch the millisecond value of a ResultSet.getTime could be > between -24h between 0h<=x<24h. If someone thinks this change is not acceptable I'll > go back and revert it re-fix the test cases to match. I'm not sure if this is right. In theory Time values are meant to have a day/month/year of Jan 1 1970. Time (via Date) uses the local timezone to compute the day/month/year. But to represent all time values in all local timezones that means you need negative millisecond values (to handle timezones ahead of UTC). For example, Jan 1 1970 02:00 +1200 is actually Dec 31 1969 14:00 UTC, which is a negative milliseconds value. There's an additional complication that if you're dealing with time values in different timezones, it'd imply that 2am +1200 is identical to 2pm UTC, which is not entirely true.. they're on different days. Currently they'd return Time values that are exactly one day apart, with this change they'd return identical Time values. As usual, the javadoc is fairly hopeless at telling you how Time is actually supposed to behave! (I wonder what java.sql.Time.valueOf() returns in timezones ahead of UTC? Might be worth testing..) -O