Reputation: 127
Subtracting 'n' days from current date could be done using:
from datetime import datetime, timedelta
datetime.today() - timedelta(days=42)
Similarly, Is there a way to subtract 'n' weeks from current date in python
Upvotes: 2
Views: 5347
Reputation: 17
Unnecessary, but you can also do:
datetime.today() - timedelta(days=n*7)
Upvotes: -1