I'm trying to convert a string into a datetime object...
time = '10:00:00'
date = '2016-10-03'
date = date + ' ' + time
print date
date = datetime.strptime(date, '%Y-%m-%d %H:%M:%y')
print date
this prints out:
2016-10-03 10:00:00
2000-10-03 10:00:00
for some reason it changes the year date..
when I do:
date = '2016-10-03'
date = datetime.strptime(date, '%Y-%m-%d')
print date
It works correct and I get:
2016-10-03
How come when I add the time in there it changes the year?
Thanks