RE: Date question - Mailing list pgsql-sql

From Francis Solomon
Subject RE: Date question
Date
Msg-id NEBBIFFPELJMCJAODNPKOEKLCHAA.francis@stellison.co.uk
Whole thread Raw
In response to Date question  (Boulat Khakimov <boulat@inet-interactif.com>)
List pgsql-sql
Hi Boulat,

stasis=# select (now() + '1 year')::date;
  ?column?
------------
 2002-03-06
(1 row)

Hope this helps

Francis

> Hi,
>
> Im a little bit stuck here.
>
> Does anyone know how to get date in format 'YYYY-MM-DD' of a date one
> year from now.
> So for example today is '2001-03-06' I need to get date 12 months from
> now
> which will be '2002-03-06' in todays case...
>
> In mysql I used  DATE_ADD(CURDATE(), INTERVAL 12 MONTH) , but that
> doesnt work in PG.
>
>
> Regards,
> Boulat Khakimov


pgsql-sql by date:

Previous
From: Boulat Khakimov
Date:
Subject: Date question
Next
From: Michael Fork
Date:
Subject: Re: Date question