Re: date math: converting interval result to seconds

From: "Peter Gibbs" <peter(at)emkel(dot)co(dot)za>
To: "Daniel Kelley" <dkelley(at)otec(dot)com>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: date math: converting interval result to seconds
Date: 2002-08-19 14:41:56
Message-ID: 027c01c2478e$91181d40$0b01010a@emkel.co.za
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Daniel Kelley wrote:

> 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

select date_part('epoch', current_timestamp-stime)

--
Peter Gibbs
EmKel Systems

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Joe Conway 2002-08-19 15:12:19 Re: bytea operator bugs (was Re: [GENERAL] BYTEA, indexes
Previous Message Daniel Kelley 2002-08-19 14:21:40 date math: converting interval result to seconds