Re: get difference between two timestamp value in second?

From: Thomas Lockhart <lockhart(at)alumni(dot)caltech(dot)edu>
To: Sergiy Ovcharuk <Sergey(dot)Ovcharuk(at)tessart(dot)kiev(dot)ua>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: get difference between two timestamp value in second?
Date: 2001-04-19 14:54:20
Message-ID: 3ADEFC1C.A2DA386A@alumni.caltech.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> Does anybody knows how I can get the difference between two date (timestamp)
> is secondes or convert timestamp to integer or float type (in any acceptable
> sense).

lockhart=# select date_part('epoch', timestamp 'today' - timestamp
'yesterday');
date_part
-----------
86400

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2001-04-19 15:09:22 Re: Re: No printable 7.1 docs?
Previous Message Tom Lane 2001-04-19 14:40:28 Re: Re: [BUG?] tgconstrrelid doesn't survive a dump/restore