Re: Small addition to PGInterval

From: Kris Jurka <books(at)ejurka(dot)com>
To: Hartmut Benz <hartmut(dot)benz(at)ti-wmc(dot)nl>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Small addition to PGInterval
Date: 2007-04-11 11:10:24
Message-ID: Pine.BSO.4.64.0704110704480.1156@leary.csoft.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

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

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Xavier Poinsard 2007-04-11 13:21:29 Re: Prepared statement parameter and timestamp
Previous Message Hartmut Benz 2007-04-11 10:52:42 Re: Small addition to PGInterval