From: clayton cottingham <drfrog@smartt.com>
To: Francis Solomon <francis@stellison.co.uk>
Cc: Boulat Khakimov <boulat@inet-interactif.com>
Cc: pgsql-sql@postgresql.org
Cc: psql-novice@postgresql.org
Cc: pgsql-general@postgresql.org
Subject: Re: [SQL] Date question
Date: Tue, 06 Mar 2001 12:37:27 -0800
Message-ID: <3AA54A87.EFA4EDAE@smartt.com> (raw)
References: <NEBBIFFPELJMCJAODNPKOEKLCHAA.francis@stellison.co.uk>
Francis Solomon wrote:
>
> 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
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
i dunno about you but i like this syntax better than the old :: ones
select date(now()+ '1 year');
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: drfrog@smartt.com, francis@stellison.co.uk, boulat@inet-interactif.com, psql-novice@postgresql.org, pgsql-general@postgresql.org
Subject: Re: [SQL] Date question
In-Reply-To: <3AA54A87.EFA4EDAE@smartt.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox