Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id D4E5F9FB5CB for ; Wed, 11 Apr 2007 04:53:40 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 10716-05 for ; Wed, 11 Apr 2007 04:53:35 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from mail63.csoft.net (leary.csoft.net [205.205.214.5]) by postgresql.org (Postfix) with SMTP id 89FBD9FB585 for ; Wed, 11 Apr 2007 04:53:37 -0300 (ADT) Received: (qmail 14672 invoked by uid 1112); 11 Apr 2007 07:53:35 -0000 Date: Wed, 11 Apr 2007 03:53:35 -0400 (EDT) From: Kris Jurka X-X-Sender: books@leary.csoft.net To: Hartmut Benz cc: pgsql-jdbc@postgresql.org Subject: Re: Small addition to PGInterval In-Reply-To: <460BB869.3050200@ti-wmc.nl> Message-ID: References: <460BB869.3050200@ti-wmc.nl> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200704/14 X-Sequence-Number: 16863 On Thu, 29 Mar 2007, Hartmut Benz wrote: > please find attached a small extension to PGInterval: > - getTimeInMillis - returns the number of milliseconds in the interval getLengthInMillis doesn't account for months. ONE_YEAR is seconds in a year instead of milliseconds. Shouldn't we use the server's definition instead of google's for a year's length in seconds: select extract(epoch from '1 year'::interval); date_part ----------- 31557600 (1 row) > - copying constructor PGInterval(PGInterval) for type-safe, cast-free cloning > - now implements Comaparable We can't use generics in this class because it must be buildable with older JDK versions. Also context diffs (-c) are preferred. Kris Jurka