Created
September 22, 2016 00:49
-
-
Save libert-xyz/13f69eff9c4c16b2abaf41d6a3b3cfff 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
import time | |
#Example of counting days to an event: | |
from datetime import date | |
today = date.today() | |
today | |
today == date.fromtimestamp(time.time()) | |
my_birthday = date(today.year, 6, 24) | |
if my_birthday < today: | |
my_birthday = my_birthday.replace(year=today.year + 1) | |
my_birthday | |
time_to_birthday = abs(my_birthday - today) | |
time_to_birthday.days |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment