I want to write a function which takes in a nonnegative integer number of seconds s and returns a list in the same format [days, hours, minutes, seconds]. I found one post about it here but I am a beginner (literally started using Python two weeks ago) so I'm looking for a simple function. I know I probably need to use mod or % or something but I'm having trouble starting
Asked
Active
Viewed 231 times
0
-
2Possible duplicate : http://stackoverflow.com/questions/4048651/python-function-to-convert-seconds-into-minutes-hours-and-days – shaktimaan Apr 10 '14 at 02:47
-
Will your calculation ever be applied for a time starting on December 31 and ending on January 1? – Ignacio Vazquez-Abrams Apr 10 '14 at 03:06