https://blog.csdn.net/qq_18863573/article/details/79444094
第三方模块 :python-dateutil
安装方式:pip install python-dateutil
实例代码:
import datetime
from dateutil.relativedelta import relativedelta
datetime_now = datetime.datetime.now()
datetime_three_month_ago = datetime_now - relativedelta(months=3)
print datetime_three_month_ago