Python获取上个月的第一天和最后一天

import datetime
today_date = datetime.date.today()
fist_day_of_last_month = datetime.date(today_date.year, today_date.month - 1, 1)
last_day_of_last_month = datetime.date(today_date.year, today_date.month, 1) - datetime.timedelta(1)
正文完
 0
评论(没有评论)