pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kris Jurka <books@ejurka.com>
To: Hartmut Benz <hartmut.benz@ti-wmc.nl>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Small addition to PGInterval
Date: Wed, 11 Apr 2007 07:10:24 -0400 (EDT)
Message-ID: <Pine.BSO.4.64.0704110704480.1156@leary.csoft.net> (raw)
In-Reply-To: <461CBDFA.6080205@ti-wmc.nl>
References: <460BB869.3050200@ti-wmc.nl>
	<Pine.BSO.4.64.0704110347270.5256@leary.csoft.net>
	<461CBDFA.6080205@ti-wmc.nl>



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



view thread (6+ messages)  latest in thread

Message-ID: <Pine.BSO.4.64.0704110704480.1156@leary.csoft.net>
Permalink:  ../Pine.BSO.4.64.0704110704480.1156@leary.csoft.net/
Also on:    postgresql.org/message-id/Pine.BSO.4.64.0704110704480.1156@leary.csoft.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: books@ejurka.com, hartmut.benz@ti-wmc.nl
  Subject: Re: Small addition to PGInterval
  In-Reply-To: <Pine.BSO.4.64.0704110704480.1156@leary.csoft.net>
  References: <460BB869.3050200@ti-wmc.nl> <Pine.BSO.4.64.0704110347270.5256@leary.csoft.net> <461CBDFA.6080205@ti-wmc.nl> <Pine.BSO.4.64.0704110704480.1156@leary.csoft.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox