电脑上按Ctrl + D,下次访问更方便
服务分类

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)

发表回复

登录后才能评论
联系我们

联系我们

微信客服:

fuwu360微信客服

工作时间:周一至周五,9:30-18:30,节假日休息

返回顶部