RE: [SQL] Date question

Francis Solomon <francis@stellison.co.uk>

From: "Francis Solomon" <francis@stellison.co.uk>
To: "Boulat Khakimov" <boulat@inet-interactif.com>, <pgsql-sql@postgresql.org>, <psql-novice@postgresql.org>, <pgsql-general@postgresql.org>
Date: 2001-03-06T19:30:03Z
Lists: pgsql-general
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