python - How to subtract a day from a date? - Stack Overflow


PHOTO EMBED

Tue Sep 01 2020 17:25:10 GMT+0000 (UTC)

Saved by @arielvol #python

from datetime import datetime, timedelta

d = datetime.today() - timedelta(days=days_to_subtract)
content_copyCOPY

https://stackoverflow.com/questions/441147/how-to-subtract-a-day-from-a-date