Python date conversion
Question: Okay, I give up. Python version 2.7.2

    
    
    >>> from datetime import datetime
    >>> datestr = "2014-01-24"
    >>> displaydateobj = datetime.date(datetime.strptime(datestr,'%Y-%d-%m'))
    Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    File "C:\Python27\lib\_strptime.py", line 328, in _strptime
    data_string[found.end():])
    ValueError: unconverted data remains: 4
    

What am I missing? I have reviewed the strptime format strings a dozen times.


Answer: Should that be:

`datetime.date(datetime.strptime(datestr,'%Y-%m-%d'))`?

