now = datetime.datetime.now()
this_month_start = datetime.datetime(now.year, now.month, 1)
this_month_end = datetime.datetime(now.year, now.month, calendar.monthrange(now.year, now.month)[1])
Reference resources
https://zhuanlan.zhihu.com/p/95919866