I'm trying to format the time string "2016-01-01 00:00:00" to a datetime object. I tried the following code:
from datetime import datetime
a = '2016-01-01 00:00:00'
d = datetime.strptime(a,'%Y%m%d %H:%M:%S')
But I got the error message saying:
ValueError: time data '2016-01-01 00:00:00' does not match format '%Y%m%d %H:%M:%S'
What's wrong with my code? Thank you all for helping me!!!