python 日期加减

pip install python-dateutil

import datetime
from dateutil.relativedelta import relativedelta

now = datetime.date(2019, 7, 30)
print(now + relativedelta(months = 1))
print(now + relativedelta(years = 1))
print(now + relativedelta(days = 1))
posted @ 2019-07-30 18:13 lr.cool 阅读(...) 评论(...) 编辑 收藏