I get the following error:
time data \'07/28/2014 18:54:55.099000\' does not match format \'%d/%m/%Y %H:%M:%S.%f\'
But I cannot see what pa
I had the exact same error but with slightly different format and root-cause, and since this is the first Q&A that pops up when you search for "time data does not match format", I thought I'd leave the mistake I made for future viewers:
My initial code:
start = datetime.strptime('05-SEP-19 00.00.00.000 AM', '%d-%b-%y %I.%M.%S.%f %p')
Where I used %I to parse the hours and %p to parse 'AM/PM'.
The error:
ValueError: time data '05-SEP-19 00.00.00.000000 AM' does not match format '%d-%b-%y %I.%M.%S.%f %p'
I was going through the datetime docs and finally realized in 12-hour format %I, there is no 00... once I changed 00.00.00 to 12.00.00, the problem was resolved.
So it's either 01-12 using %I with %p, or 00-23 using %H.