1๐
โ
Iโm assuming getting the total/count is not a big issue here.
Since you already have the datetime object ie.: (2021, 3, 1,0,0, โฆ) , you can extract the Month name using obj.strftime("%B")
Like this:
>>> date_obj
datetime.datetime(2021, 3, 1, 0, 0, tzinfo=<DstTzInfo 'Asia/Dhaka' LMT+6:02:00 STD>)
>>> month = date_obj.strftime("%B")
>>> month
'March'
You can also get short version of months, weekdays etc : Python documentation: strftime
๐คNeeraj
Source:stackexchange.com