date math: converting interval result to seconds

From: Daniel Kelley <dkelley(at)otec(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: date math: converting interval result to seconds
Date: 2002-08-19 14:21:40
Message-ID: Pine.BSF.4.20L2.0208191020560.60783-100000@mx1.gc.ny.otec.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


hi-

i'm trying to do something like this:

triv=> SELECT current_timestamp-stime as tm FROM triv_a_r WHERE tq_id =
'QM7DGLU15' AND fid_c = 'PTA42BEAE';
tm
-----------------------
2 days 18:32:46.06146
(1 row)

but i'd like the resulting interval to be represented in seconds. i've
looked through the various date functions in the docs (date_part,
date_trunc, extract), and none of them seem to do this. are there any
such date conversion functions?

i'm using 7.2.1 on solaris 8.

thanks-

dan

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Peter Gibbs 2002-08-19 14:41:56 Re: date math: converting interval result to seconds
Previous Message Jeff Eckermann 2002-08-19 14:14:33 Re: Success: Finished porting application to postgreSQL