get date from 5 days ago python code example Example: 1 day ago python datetime date_N_days_ago = datetime.now() - timedelta(days=N)