Re: [QUESTIONS] select date('now'::datetime+'30 day'::timespan)

Brett McCormickS <brett@abraxas.scene.com>

From: Brett McCormick <brett@abraxas.scene.com>
To: "Thomas G. Lockhart" <lockhart@alumni.caltech.edu>
Cc: pgsql-questions@postgresql.org, pgsql-hackers@postgresql.org
Date: 1998-01-28T00:03:42Z
Lists: pgsql-hackers
I was just using 30 days because that's what the previous fellow used..
it works, but some of the time conversion routines are still messed up.

select date('now'::datetime),date(datetime(date('now'::datetime)));
      date|      date
----------+----------
01-27-1998|01-26-1998
(1 row)

those should be the same correct?  it appears to get messed up in the
datetime(date) conversion..

--brett

On Tue, 27 January 1998, at 08:21:22, Thomas G. Lockhart wrote:

> btw, if you want to add a month, better to use
> 
> postgres=> select date( cast 'now'::date as datetime + '1
> month'::timespan);
>       date
> ----------
> 02-27-1998
> (1 row)
> 
> (The important thing is the '1 month' time span; ignore the casting
> until v6.3 :)