import datetime as dt #print(potus[0:]) #Start_date=0 date_format='%m/%d/%y %H:%M' for row in potus[0:4]: appt_start_date=row print(appt_start_date) Start_date=dt.datetime.strptime(appt_start_date,date_format) print(Start_date) row=Start_date print(row) print(potus[0:3])
What I expected to happen:
I was hoping this code updates all the row values in potus list with updated date format.
What actually happened:
when the potus list is updated it at row it shows output as datetime.datetime(2015, 1, 6, 9, 30) instead of 2015-01-06 09:30:00.
When I tried to debug, and added print messages at every line, while the code executes, the variables looks right. However in the end when it updates the potus list, and when I print Potus list, it doesn’t get updated correctly.
Replace this line with the output/error