datetime now - 1 day python code example
Example: python today - 1 day
from datetime import datetime, timedelta
yesterday = datetime.today() - timedelta(days = 1 )
from datetime import datetime, timedelta
yesterday = datetime.today() - timedelta(days = 1 )