from datetime import datetime, timedelta
def get_month_b_e_day(month):
month_begin_day = month + "01"
next_month = int(month) + 1
if(next_month % 100 == 13):
next_month = next_month - 12 + 100
month_end_day = (datetime(int(str(next_month)[0:4]), int(str(next_month)[4:6]), 1) - timedelta(days=1)).strftime("%Y%m%d")
begin_time = "-".join([month_begin_day[:4], month_begin_day[4:6], month_begin_day[6:8]]) + " " + "00:00:00"
end_time = "-".join([month_end_day[:4], month_end_day[4:6], month_end_day[6:8]]) + " " + "23:59:59"
return begin_time,end_time
begin_time,end_time = get_month_b_e_day("201912")
print(begin_time)
print(end_time)