Skip to content

Instantly share code, notes, and snippets.

@d0mmie
Created January 8, 2021 14:41
Show Gist options
  • Save d0mmie/f002330419db718ef965f5ccfd92b86b to your computer and use it in GitHub Desktop.
Save d0mmie/f002330419db718ef965f5ccfd92b86b to your computer and use it in GitHub Desktop.
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