Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Best way to convert seconds to hours:minutes:seconds

Re: Best way to convert seconds to hours:minutes:seconds

From: Thorsten Kettner <thorsten.kettner_at_web.de>
Date: 2 Jan 2007 05:02:09 -0800
Message-ID: <1167742929.269738.31220@k21g2000cwa.googlegroups.com>


If you need HH:MI:SS format for more then 23:59:59, then you need to calculate it:

select to_char(:secs/3600,'FM99900') ||':'|| to_char(mod(:secs,3600)/60,'FM00') ||':'|| to_char(mod(:secs,60),'FM00')
from dual

b_addams_at_yahoo.com schrieb:

> I have a table that stores elapsed seconds as a numeric value. There is
> a PHP script that displays data from this table onto a web page. What
> is the best way to display the elapsed time in an HH:MI:SS format?
> Obviously the to_char function only works on dates, so I am not sure
> how to go about this. Do I need to create an internal PL/SQL function
> that is called from my PHP SQL?
>
> Thanks.
Received on Tue Jan 02 2007 - 07:02:09 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US