Created
March 8, 2017 22:50
-
-
Save dansku/f1b2770f62eb7b934eac596c7b79da99 to your computer and use it in GitHub Desktop.
Display a countdown for the numbers of the day until a certain date
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
| #calculate time differnece | |
| import time | |
| import os | |
| while True: | |
| now = time.time() #1488997525 | |
| end = 1517504400 | |
| difference = end - now | |
| if difference > 0: | |
| days = int(difference / 86400) | |
| hours = int((difference - (days * 60 * 60 * 24))/(60*60)) | |
| minutes = int((difference - (days * 60 * 60 * 24) - (hours * 60 * 60 ))/60) | |
| seconds = int(difference - (days * 60 * 60 * 24) - (hours * 60 * 60 ) - (minutes * 60)) | |
| print str(days) + " " + str(hours)+":"+str(minutes)+":"+str(seconds) | |
| else: | |
| print "666 66:66:66" | |
| time.sleep(0.1) | |
| os.system('cls') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment