Re: Get interval in months

From: Gerhard Heift <ml-postgresql-20081012-3518(at)gheift(dot)de>
To: PostgreSQL general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Get interval in months
Date: 2008-11-10 15:33:13
Message-ID: 20081110153312.GB11099@toaster.kawo1.rwth-aachen.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sat, Nov 08, 2008 at 07:44:45AM -0500, David Spadea wrote:
> Gerhard,
>
> Check out:
>
> http://www.postgresql.org/docs/8.3/interactive/functions-datetime.html
>
> In particular, look at 'age()' or 'justify_days()', but I think age() is the
> one you want.
>
>
> SELECT age('2008-02-01'::timestamp, '2008-01-01'::timestamp) AS "1 month"
>
> Produces: "1 mon"

This was the function I searched. Thank you.

Gerhard

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Joao Ferreira gmail 2008-11-10 15:36:13 Re: Upgrading Postgres question
Previous Message Gerhard Heift 2008-11-10 15:31:31 Logging in function with exception