Re: Formatting seconds in MM:SS
From: Maxim Demenko <mdemenko_at_arcor.de>
Date: Tue, 04 Mar 2008 07:35:09 +0100
Message-ID: <47CCED9D.1070100@arcor.de>
Date: Tue, 04 Mar 2008 07:35:09 +0100
Message-ID: <47CCED9D.1070100@arcor.de>
Jens Riedel schrieb:
> Hi,
>
> I need to display a number of seconds in the <minutes>:<seconds>
> notation, e.g. 100 seconds shall return '01:40'.
> Hours shall NOT be displayed, so for example 7201 seconds shall return
> '120:01', not '02:00:01'...
>
> Has anyone a hint how I can achieve this?
>
> Thanx and best regards,
> Jens
You already got some ideas how to solve your problem, just in case, your input is not time but simply a number of seconds, you can do something like this
SQL> with t as (
2 select 100 s from dual union all
3 select 7201 from dual)
4 select s,trunc(s/60)||':'||mod(s,60) "M:S" from t;
S M:S
100 1:40 7201 120:1
Best regards
Maxim Received on Tue Mar 04 2008 - 00:35:09 CST