Re: Re: Problem with Dates - Mailing list pgsql-sql

From Brett W. McCoy
Subject Re: Re: Problem with Dates
Date
Msg-id Pine.LNX.4.30.0101242158130.8496-100000@chapelperilous.net
Whole thread Raw
In response to Re: Problem with Dates  ("Glen and Rosanne Eustace" <agree@godzone.net.nz>)
List pgsql-sql
On Thu, 25 Jan 2001, Glen and Rosanne Eustace wrote:

> pressie# select '31/12/2000'::date + '1 year'::timespan;
>           ?column?
> -----------------------------
>  01/01/2002 00:00:00.00 NZDT
> (1 row)
>
> pressie=#
>
> Well I do :-(
>
> I vaguely remember someone else having the same problem and it was
> something to do with daylight saving.  I don't recall the solution
> though, if there was one.

It might also have something to do with your timezone.  I did the exact
same query on my server and got the correct result:

cp=> select '31/12/2000'::date + '1 year'::timespan;       ?column?
------------------------2001-12-31 00:00:00-05
(1 row)

cp=>

What happens if instead you add the days?

-- Brett                                    http://www.chapelperilous.net/~bmccoy/
---------------------------------------------------------------------------
We are what we are.



pgsql-sql by date:

Previous
From: Mike Castle
Date:
Subject: Re: Problem with Dates
Next
From: Som
Date:
Subject: Insertion and Retrieval of BLOB