Received: from mail.postgresql.org (webmail.postgresql.org [216.126.85.28]) by mail.postgresql.org (8.11.1/8.11.1) with SMTP id f2CJutx54782 for ; Mon, 12 Mar 2001 14:56:55 -0500 (EST) (envelope-from pgsql-general-owner@postgresql.org) Received: from marketingchallenge.com (marketingchallenge.com [64.40.111.205] (may be forged)) by mail.postgresql.org (8.11.1/8.11.1) with SMTP id f26KZcx79510 for ; Tue, 6 Mar 2001 15:35:38 -0500 (EST) (envelope-from drfrog@smartt.com) Received: (qmail 2758 invoked from network); 6 Mar 2001 20:35:32 -0000 Received: from clayton-cottingham.imc (HELO smartt.com) (drfrog@10.1.4.1) by marketingchallenge.com with SMTP; 6 Mar 2001 20:35:32 -0000 Message-ID: <3AA54A87.EFA4EDAE@smartt.com> Date: Tue, 06 Mar 2001 12:37:27 -0800 From: clayton cottingham X-Mailer: Mozilla 4.76 [en] (X11; U; Linux 2.2.17-21mdk i686) X-Accept-Language: en MIME-Version: 1.0 To: Francis Solomon CC: Boulat Khakimov , pgsql-sql@postgresql.org, psql-novice@postgresql.org, pgsql-general@postgresql.org Subject: Re: [SQL] Date question References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive-Number: 200103/516 X-Sequence-Number: 6004 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');