Re: interval conversion

From: "Brett Dikeman" <brett(at)cloud9(dot)net>
To: "Tomasz Myrta" <jasiek(at)klaster(dot)net>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: interval conversion
Date: 2003-08-28 15:45:11
Message-ID: 64358.63.142.161.101.1062085511.squirrel@frank.mercea.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


>> I have a possibly stupid question- I'm doing some time calculations yielding
>> intervals, and for my purposes I need to convert the interval(say, "1 day 8
>> hours") into (floating point) hours. While there's a plethora of handy
>> date_extract functionality and the like, I need a conversion.
>>
>> Any suggestions on how to accompish this? Simpler the better, of course.
>
> extract(epoch from some_interval)/3600

[slaps head] I swear, I studied the date/time sections of the manual for quite
some time...really...Siiiigh :-)

Thanks Tomasz!

Brett

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Joe Conway 2003-08-28 21:27:32 Re: length of array
Previous Message Tomasz Myrta 2003-08-28 14:40:09 Re: interval conversion