SQL Convert minutes to minutes:minutes:seconds

Asked

Viewed 9,153 times

2

How to convert a value in minutes in oracle to the time:minutes:seconds format?

1 answer

5

Convert minutes to hour:min:sec format, for example 1000 minutes converted would be 16:40:00

SELECT 
   TO_CHAR(TRUNC((MINUTES * 60) / 3600), 'FM9900') || ':' ||
   TO_CHAR(TRUNC(MOD((MINUTES * 60), 3600) / 60), 'FM00') || ':' ||
   TO_CHAR(MOD((MINUTES * 60), 60), 'FM00') AS MIN_TO_HOUR FROM DUAL
  • 1

    Interesting, I made the application in a function related to difference in Hours, Minutes and Seconds of a date and another. Vlw

Browser other questions tagged

You are not signed in. Login or sign up in order to post.