Re: fomatting an interval (resend)

Forest Wilkinson <lyris-pg@tibit.com>

From: lyris-pg@tibit.com
To: pgsql-general@postgresql.org
Cc: greg@turnstep.com
Date: 2003-05-29T21:26:16Z
Lists: pgsql-hackers
>> Okay, so extract() doesn't fit the bill either.  How do I get the
>> difference between two timestamps in terms of days, expressed as an
>> integer?  Moreover, how do I get any interval expressed in those
>> terms?
>
>select round((extract(epoch from finish) - extract(epoch from start))/(60*60*24)) 
>  from timetable;

How would that differ from the query below?

select round(extract(epoch from (finish - start))/(60*60*24)) from
timetable;