Re: Problem with date calculation

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Patrick FICHE <Patrick(dot)FICHE(at)AQSACOM(dot)COM>
Cc: "PostgreSQL - General (E-mail)" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Problem with date calculation
Date: 2002-08-26 15:37:25
Message-ID: 20020826083418.G61321-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, 26 Aug 2002, Patrick FICHE wrote:

> Hi,
>
> I'm a newbie to Postgresql and have a problem manipulating dates in a
> function...
>
> In fact, I want a function to add some days to the current date and return
> the result date.
>
> My code would be something like :
>
> _DTcurrent := NOW() + interval ''_INTdays days'';

I think,
_DTcurrent := NOW() + CAST( _INTdays || '' days'' as interval);

will work.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Patrick FICHE 2002-08-26 15:50:23 Re: Problem with date calculation
Previous Message Patrick FICHE 2002-08-26 15:29:51 Problem with date calculation