SyntaxFix
Write A Post
Hire A Developer
Questions
You can use a timedelta object:
timedelta
from datetime import datetime, timedelta d = datetime.today() - timedelta(days=days_to_subtract)