Re: Date question - Mailing list pgsql-general

From Peter Eisentraut
Subject Re: Date question
Date
Msg-id Pine.LNX.4.30.0103062040000.778-100000@peter.localdomain
Whole thread Raw
In response to Date question  (Boulat Khakimov <boulat@inet-interactif.com>)
List pgsql-general
Boulat Khakimov writes:

> 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.

How about CURRENT_DATE + INTERVAL '12 months'?

--
Peter Eisentraut      peter_e@gmx.net       http://yi.org/peter-e/


pgsql-general by date:

Previous
From: "Martin A. Marques"
Date:
Subject: Re: PostgreSQL 7 on Solaris 8 - Is it working?
Next
From: Peter Eisentraut
Date:
Subject: Re: time to integer