Re: Re: Problem with Dates

From: "Brett W(dot) McCoy" <bmccoy(at)chapelperilous(dot)net>
To: Glen and Rosanne Eustace <agree(at)godzone(dot)net(dot)nz>
Cc: Mike Castle <dalgoda(at)ix(dot)netcom(dot)com>, <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Re: Problem with Dates
Date: 2001-01-25 02:59:36
Message-ID: Pine.LNX.4.30.0101242158130.8496-100000@chapelperilous.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Ian Harding 2001-01-25 03:55:27 Re: #DELETED error when using Access 2000 as frontend
Previous Message Mike Castle 2001-01-25 02:17:31 Re: Problem with Dates