from datetime import date mydate = date.today() month_first_day = date(mydate.year, mydate.month, 1) print(f"当月第一天:{month_first_day}\n")
打印结果:
# 当月第一天:2019-12-01