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
1months_in_year = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
2date = '2021-11-21 11:22:03'
3month = date.dt.month
4print(month)
5#Output
611
7
8month_name = months_in_year [month - 1]
9print(month_name)
10#Output
11November