Skip site navigation (1) Skip section navigation (2)

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 07:53:35
Message-ID: Pine.BSO.4.64.0704110347270.5256@leary.csoft.net (view raw or flat)
Thread:
Lists: pgsql-jdbc

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<PGInterval>

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

In response to

Responses

pgsql-jdbc by date

Next:From: Marc MaminDate: 2007-04-11 08:12:14
Subject: Re: Encoding issue (utf8): different strings received from java than from PGAdmin
Previous:From: Kris JurkaDate: 2007-04-10 17:57:27
Subject: Re: Exception in running query

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group