Re: DateDiff in PostgreSQL

From: Rod Taylor <pg(at)rbt(dot)ca>
To: "George A(dot)J" <jinujosein(at)yahoo(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: DateDiff in PostgreSQL
Date: 2003-11-07 13:55:48
Message-ID: 1068213347.42603.2.camel@jester
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

> ie, a function that returns difference of two dates(timestamp) in days
> or months or year..
>
> The - operator for timestamp retuns the intervel in days only.

rbt=# select extract('days' from current_timestamp -
'2003-01-01'::timestamp);
date_part
-----------
310
(1 row)

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message holger 2003-11-07 22:17:51 transaction processing after error in statement
Previous Message George A.J 2003-11-07 13:53:35 Re: DateDiff in PostgreSQL