i am using pandas and odo to import csv files into a database, there is a date field in file with this format 27th August 2017 23:06:25
i would like to convert is to this format %d-%m-%Y %H:%M:%S
.
Here is my the piece of code i am using:
df['Date'] = pd.to_datetime(df['Date'], format='%d-%m-%Y %H:%M:%S')
I end up with the error
ValueError: time data '27th August 2017 23:32:58' does not match format '%d-%m-%Y %H:%M:%S' (match)
Anyone having an idea solving this? please