获取当前时间月份的首日与最后一天 import calendardef get_month_start_and_end(date=datetime.datetime.now()):"""获取当前时间的月份首日与最后一天:param date::return: (首日,最后一天)"""year, month = str(date).