📜  获取去年的今天python代码示例

📅  最后修改于: 2022-03-11 14:46:06.821000             🧑  作者: Mango

代码示例1
import datetime
from dateutil.relativedelta import relativedelta

last_year = (datetime.datetime.now()-relativedelta(years=1)).strftime("%Y-%m-%d")