python
import datetime
now = datetime.datetime.now()
d = datetime.timedelta(weeks=-1)
d2 = datetime.timedelta(weeks=1)
d3 = datetime.timedelta(days=365)
print(now)
print(now + d)
print(now - d2)
print(now - d3)
Résultat d'exécution
2020-02-26 11:24:59.726696
2020-02-19 11:24:59.726696
2020-02-19 11:24:59.726696
2019-02-26 11:24:59.726696