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)
相关文章