Re: Date differences - Mailing list pgsql-general

From Devrim GUNDUZ
Subject Re: Date differences
Date
Msg-id Pine.LNX.4.44.0404060212340.1807-100000@emo.org.tr
Whole thread Raw
In response to Date differences  (Josué Maldonado <josue@lamundial.hn>)
List pgsql-general
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


Hi,

On Mon, 5 Apr 2004, [ISO-8859-1] Josué Maldonado wrote:

> Apologize me if this is so obvius. How can I know the difference in
> years/months/days between 2 dates, for instance:
>
> 04/05/2004 - 05/12/2006, there are 2years/1month/7days.

Use age() :

postgres@[local]:test=# SELECT age('05/12/2006','04/05/2004');
         age
- ----------------------
 2 years 1 mon 7 days

Regards,
- --
Devrim GUNDUZ
devrim@gunduz.org                devrim.gunduz@linux.org.tr
            http://www.TDMSoft.com
            http://www.gunduz.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQFAcef4tl86P3SPfQ4RAlQvAKDYmzL3qWBoFEp6ASjMFBp+YdkGKgCcCzGN
UY6S2qCPiqaR+tQPo4a6gaY=
=M9rI
-----END PGP SIGNATURE-----


pgsql-general by date:

Previous
From: Will Trillich
Date:
Subject: set timestamp oddness
Next
From: William White
Date:
Subject: Re: left and overleft/notright revisited: why !>> and !<<