Back
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 - DDearlier_str = earlier.strftime("%Y%m%d")
today = datetime.datetime.now()
DD = datetime.timedelta(days=90)
earlier = today - DD
earlier_str = earlier.strftime("%Y%m%d")
31k questions
32.8k answers
501 comments
693 users