1、python获取某年某月的第一天和最后一天 在写程序的时候,我们经常要获取某年某月的第一天和最后一天,如输入202208,即可得到2022-08-01 和 2022-08-31 话不多说,上代码 import calendar import datetime def get_first_last(year,month): year,month=