import datetime
from dateutil.relativedelta import relativedelta
print(datetime.date.today())
print(datetime.date.today() - relativedelta(months=+1))
print(datetime.date.today() - relativedelta(months=-3)
Python 获取上个月和下个月
最新推荐文章于 2024-07-10 09:09:09 发布