Re: Problem with Dates - Mailing list pgsql-sql

From Mike Castle
Subject Re: Problem with Dates
Date
Msg-id 20010124125552.D17481@thune.yy.com
Whole thread Raw
In response to Problem with Dates  ("Glen and Rosanne Eustace" <agree@godzone.net.nz>)
List pgsql-sql
On Thu, Jan 25, 2001 at 08:49:27AM +1300, Glen and Rosanne Eustace wrote:
> I am using 7.0.3,
> I have a column tstamp defined to be 'date';
> 
> With a current value of '31-12-2000',
> if I update tstamp=tstamp+'1 year'::timespan
> I get '1-1-2002'

This almost sounds like it takes the year 2000, figures out it needs 366
days, and uses that for "1 year".

However, I don't see that error myself:

template1=> select '2000-12-31'::timestamp+'1 year';       ?column?        
------------------------2001-12-31 00:00:00-08
(1 row)

template1=> select '2000-12-31'::timestamp+'1 year'::timespan;       ?column?        
------------------------2001-12-31 00:00:00-08
(1 row)

mrc
--       Mike Castle       Life is like a clock:  You can work constantly dalgoda@ix.netcom.com  and be right all the
time,or not work at all
 
www.netcom.com/~dalgoda/ and be right at least twice a day.  -- mrc   We are all of us living in the shadow of
Manhattan. -- Watchmen
 


pgsql-sql by date:

Previous
From: Najm Hashmi
Date:
Subject: Re: How to change the ownership of the table?
Next
From: Forest Wilkinson
Date:
Subject: Re: unreferenced primary keys: garbage collection