Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def duration(seconds, _maxweeks=99999999999):
- return ', '.join('%d %s' % (num, unit)
- for num, unit in zip([(seconds // d) % m
- for d, m in ((604800, _maxweeks),
- (86400, 7), (3600, 24),
- (60, 60), (1, 60))],
- ['wk', 'd', 'hr', 'min', 'sec'])
- if num)
Advertisement
Add Comment
Please, Sign In to add comment