Re: using dates in pgsql

From: "Tyler Colbert" <tyler(at)colberts(dot)us>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: using dates in pgsql
Date: 2003-09-03 01:44:51
Message-ID: bj3gvp$2mk$1@sea.gmane.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

"Ron Johnson" <ron(dot)l(dot)johnson(at)cox(dot)net> wrote in message
news:1062080015(dot)25751(dot)319(dot)camel(at)haggis(dot)(dot)(dot)
> On Thu, 2003-08-28 at 08:41, Tom Lane wrote:
> > <shrug> ... that's what the "date - integer" operator is defined to do.
> > If you want some other behavior, create another operator.
>

I have used something like this:
now() - interval '3 hours'

so I supposed you could do
CURRENT_DATE - interval '188 days'

this would probably work more accurately (due to leap year)
CURRENT_DATE - interval '6 months'

or if you want to take time into account
now() - interval '6 months'

Tyler Colbert

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Christopher Browne 2003-09-03 03:15:11 Re: Number of rows in a table
Previous Message Al Hulaton 2003-09-02 18:49:52 Re: Can Postgresql run in MS Windows