python datetime减一天

2023-01-31 02:01:01 python datetime
d1 = datetime.datetime.now()
d3 = d1 + datetime.timedelta(days = -1)
print datetime.date.today() + datetime.timedelta(days=-1)

print datetime.date.today() - datetime.timedelta(days=1)

相关文章