I have a list of date and time as a string,
a = ['2015-07-13 00:24:35.058', '2015-07-13 00:25:06.606', '2015-07-13 00:25:54.643']
I am trying to convert it, using this piece of code,
for d in a:
dt = datetime.datetime.strptime(d, '%Y-%m-%d %H:%M:%S')
print "Converted time: ", dt
but it prompts an error: ValueError('unconverted data remains: .058',)
Please help me.
I have also tried using %c, %f
instead of %S
but it didn't help.