python datetime minus 1 day code example
Example 1: python timestamp shift one day
from datetime import datetime, timedelta
print datetime.now() + timedelta(days=5, hours=-5)
Example 2: 1 day ago python datetime
date_N_days_ago = datetime.now() - timedelta(days=N)