vscripts/seconds-to-hr.py

12 lines
257 B
Python
Raw Normal View History

2016-04-27 14:45:46 +03:00
#!/usr/bin/env python2
from sys import argv
input = int(argv[1])
result = str()
days = input // 86400
hours = input // 3600 % 24
minutes = input // 60 % 60
seconds = input % 60
result = '{}d {}h {}m {}s'.format(days, hours, minutes, seconds)
print(result)