I have the follwoing format for my date 2014-02-23T18:42:26.000009
. I want to extract the date, so I have used the following code:
from datetime import datetime
date_object = datetime.strptime('2014-02-23T18:42:26.000009', '%Y-%m-%d')
However, I got the following error message:
Traceback (most recent call last):
File "C:/Users/d774911/PycharmProjects/GlobalData/Test2.py", line 4, in <module>
date_object = datetime.strptime('2014-02-23T18:42:26.000009', '%Y-%m-%d')
File "C:\Python34\lib\_strptime.py", line 500, in _strptime_datetime
tt, fraction = _strptime(data_string, format)
File "C:\Python34\lib\_strptime.py", line 340, in _strptime
data_string[found.end():])
ValueError: unconverted data remains: T18:42:26.000009
Any ideas?