Convert time in seconds to DdHhMmSs
Keywords: Convert time in seconds to DdHhMmSs
Question:
Quick question does someone have the code to do this. 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 withExample:
356556 = 4-Days 3-Hours 2-Minutes 36-Seconds
Answer:
time = 356556 days = time / 86400 hours = (time / 3600) - (days * 24) minutes = (time / 60) - (days * 1440) - (hours * 60) seconds = time mod 60