Today =
today = datetime.datetime.now().strftime("%Y%m%d")
90days ago
DD = datetime.timedelta(days=-90)
How do I get today - DD, or 90days ago?
You should be able to subtract time deltas from datetime objects.
today = datetime.datetime.now() DD = datetime.timedelta(days=90) earlier = today - DD earlier_str = earlier.strftime("%Y%m%d")
2.1m questions
2.1m answers
60 comments
57.0k users