How to check if a date has Passed in Python (Simply)
Question: I have looked around to see if I can find a simple method in Python to find
out if a date has passed.

For example:- If the date is `01/05/2015`, and the date; `30/04/2015` was in-
putted into Python, it would return True, to say the date has passed.

This needs to be as simple and efficient as possible.

Thanks for any help.


Answer: you may use datetime, first parse String to date, then you can compare

    
    
    import datetime
    d1 = datetime.datetime.strptime('05/01/2015', "%d/%m/%Y").date()
    d2 = datetime.datetime.strptime('30/04/2015', "%d/%m/%Y").date()
    d2>d1
    

