repl.it
@K0DYungDeku/

Milliseconds to sec

Python

No description

fork
loading
Files
  • main.py
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
def humanize_time(secs):
    mins, secs = divmod(secs, 60)
    hours, mins = divmod(mins, 60)
    
    if secs < 3600000:
      return '%02d:%02d' %(mins, secs)
    
    if secs >= 3600000:
      return '%02d:%02d:%02d' % (hours, mins, secs)


userInput = int(input("Type Seconds: \n"))
print(humanize_time(userInput/1000))
Fetching token
?