Convert Seconds to Days Hours Minutes Seconds
Keywords: Convert Seconds Days Hours Minutes Seconds
Question:
I am retrieving the time on how long it takes to do several tasks. I am getting the total time in seconds.Does any have the code to convert the time in seconds to Day(s)/Hour(s)/Minute(s)/Second(s) to make reports with
Example
356556 = 4-Days 3-Hours 2-Minutes 36-SecondsAnswer:
time = 356556 days = time / 86400 hours = (time / 3600) - (days * 24) minutes = (time / 60) - (days * 1440) - (hours * 60) seconds = time mod 60 title = StrCat(time," seconds = ") msg = StrCat(days," Days", @crlf, hours," Hours", @crlf, minutes," Minutes",@crlf,seconds," Seconds") Message(title,msg)