Skip to navigation
Compare 2 dates in python
09.09.25
Compare 2 dates in python one date from a database as 112 format and the other 2 years back ```python date = datetime.now() - timedelta(days=2 * 365) enter_date = datetime.strptime(i["enter_date"], "%Y%m%d") if enter_date < date: print("{0}-{1}".format(enter_date, date)) ```
https://coderivers.org/blog/string-date-2-year-ago-python/
Reply
Anonymous
Information Epoch 1757719709
Live free or die.
Home
Notebook
Contact us