Created
January 8, 2021 14:41
-
-
Save d0mmie/f002330419db718ef965f5ccfd92b86b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ms = int(input("Input number of millisecons: ")) | |
remainHour = ms % (1000 * 60 * 60 * 24) | |
remainMinute = remainHour % (1000 * 60 * 60) | |
remainSecond = remainMinute % (1000 * 60) | |
remainMillesec = remainSecond % 1000 | |
print("Result = %d day(s), %d hour(s), %d minute(s), %d second(s), and %d millisec(s)" % (ms /(1000 * 60 * 60 * 24), remainHour / (1000 * 60 * 60), remainMinute / (1000 * 60) , remainSecond / 1000, remainMillesec )) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment