"Harlin Seritt" <[EMAIL PROTECTED]> writes:
> I would like to take milliseconds and convert it to a more
> human-readable format like:
> 
> 4 days 20 hours 10 minutes 35 seconds

# To iterate is human; to recurse, divine.
def dhms(m,t):
   if not t: return (m,)
   return rl(m//t[0], t[1:]) + (m % t[0],)

human_readable = '%d days %d hours %d minutes %d seconds'% \
   dhms(msec//1000, (60, 60, 24))
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to