Browse Source

seconds-to-hr as a script as well

Von Random 3 years ago
parent
commit
998130ea46
1 changed files with 11 additions and 0 deletions
  1. 11
    0
      seconds-to-hr.py

+ 11
- 0
seconds-to-hr.py View File

@@ -0,0 +1,11 @@
1
+#!/usr/bin/env python2
2
+from sys import argv
3
+
4
+input = int(argv[1])
5
+result = str()
6
+days = input // 86400
7
+hours = input // 3600 % 24
8
+minutes = input // 60 % 60
9
+seconds = input % 60
10
+result = '{}d {}h {}m {}s'.format(days, hours, minutes, seconds)
11
+print(result)

Loading…
Cancel
Save