1import datetime
2date = '2021-05-21 11:22:03'
3datem = datetime.datetime.strptime(date, "%Y-%m-%d %H:%M:%S")
4print(datem.day) # 25
5print(datem.month) # 5
6print(datem.year) # 2021
7print(datem.hour) # 11
8print(datem.minute) # 22
9print(datem.second) # 3
1import calander
2ear = int(input("Input the year:- "))
3Month = int(input("Input the month:- "))
4print(calendar.month(y, m))