计算当前日期前后几年or月or日的日期


```python
import datetime
from dateutil.relativedelta import relativedelta

print(datetime.date.today())
print(datetime.date.today() - relativedelta(days=-8))
print(datetime.date.today() - relativedelta(months=+4))
print(datetime.date.today() + relativedelta(years=-4))

你可能感兴趣的:(python)