-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathfeestje.py
More file actions
32 lines (27 loc) · 840 Bytes
/
Copy pathfeestje.py
File metadata and controls
32 lines (27 loc) · 840 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
"""Calculate days alive now
Project: Feestje
Dick Stada
Oct. 2018
"""
import calendar
import datetime
a = int(input("Enter your birthday first enter your birth year : "))
b = int(input("Enter your month now : "))
c = int(input("Enter your day now : "))
today = datetime.date.today()
birthday = datetime.date(a, b, c)
diff = birthday - today
a = diff.days
b = -a
print("Today is your {}th day.".format(b))
from dateutil.relativedelta import *
from datetime import date
today = date.today()
dob = date(1982, 7, 5)
age = relativedelta(today, dob)
print(age)
datetime.datetime.today()
# datetime.datetime(2012, 3, 23, 23, 24, 55, 173504)
datetime.datetime(2012, 3, 23)
print(datetime.datetime.today().weekday())
print(["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"][calendar.weekday(2017, 12, 22)])