Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 742829FB1CE for ; Wed, 11 Apr 2007 08:10:29 -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 98904-07 for ; Wed, 11 Apr 2007 08:10:16 -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 283C89FA50C for ; Wed, 11 Apr 2007 08:10:25 -0300 (ADT) Received: (qmail 319 invoked by uid 1112); 11 Apr 2007 11:10:24 -0000 Date: Wed, 11 Apr 2007 07:10:24 -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: <461CBDFA.6080205@ti-wmc.nl> Message-ID: References: <460BB869.3050200@ti-wmc.nl> <461CBDFA.6080205@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/19 X-Sequence-Number: 16868 On Wed, 11 Apr 2007, Hartmut Benz wrote: > Thanks for pointing this out. I corrected the bug (months) and use the server > definition for both year and month. It is a bit problematic to determine the > 'correct' number of seconds in these kind of intervals because there are so > many of them :-) Does getLengthInMillis have any external value or is it solely useful for implementing compareTo? I fear that people will try to do something like: Date d = new Date(); PGInterval i = new PGInterval("1 year"); d.setTime(d.getTime() + i.getLengthInMillis()); instead of using the exising i.add(d) method. As you mention it's not entirely clear what value it should be returning, so I'd prefer not to expose it unless you have a more useful use case. Kris Jurka