SQL Language (MOSC)

MOSC Banner

Converting time duration(in seconds) to hh:mm:ss

edited May 14, 2012 8:39PM in SQL Language (MOSC) 1 commentAnswered
Hi,
I have a requirement of converting a process time duration(in seconds) into hh:mm:ss format..
For this i need to make three variables that will separately store hour, minute, and second component. And then hh:mm:ss will be obtained by concatenating.
Eg Duration:5798secs
vhh=01
vmm=36
vss=38

hh:mm:ss = 01:36:38

I understand this can be done using trunc and mod.. but i am stuck -- when calculating minute and trunc(duration,60)is >= 60, in this case we need to increase the hour variable.

Please help..

Thanks

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center