-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathday 5.1.py
More file actions
25 lines (25 loc) · 732 Bytes
/
Copy pathday 5.1.py
File metadata and controls
25 lines (25 loc) · 732 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
import datetime
ob=datetime.datetime.now()
print(type(ob))
print("-"*25)
print(ob)
print(ob.year)
print(ob.month)
print(ob.day)
print(ob.hour)
print(ob.minute)
print(ob.second)
str1=str(ob.hour)+':'+str(ob.minute)+":"+str(ob.second)
print(str1)
print("-",25)
print("1 week ago it was:",ob-datetime.timedelta(weeks=1))
print("100 days ago it was :",ob-datetime.timedelta(days=100))
print("1 week from now it will be:",ob+datetime.timedelta(weeks=1))
print("1000 days later it will be:",ob+datetime.timedelta(days=1000))
yy=int(input("Enter the year"))
mm=int(input("Enter the Month"))
dd=int(input("Enter the Day"))
bday=datetime.datetime(yy,mm,dd)
print("-"*25)
print("Birthday in..",ob-bday)
print("-"*25)