0 points

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


dashboard

Mon May 25 2020 09:24:31 GMT+0000 (UTC)

Posted by @salitha.pathi #python

from datetime import datetime, timedelta

d = datetime.today() - timedelta(days=days_to_subtract)
content_copy Copy

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