I’m working on screen 5, Using Strptime to Parse Strings as Dates, of the Working with Dates and Times in Python mission and getting a result that doesn’t look correct but still passes the autograder.
I input the following code:
import datetime as dt
date_format = "%m/%d/%y %H:%M"
for row in potus:
start = row[2]
start = dt.datetime.strptime(start, date_format)
row[2] = start
print(potus[:2], "\n")
The result is:
[[‘Joshua T. Blanton’, ‘2014-12-18T00:00:00’, datetime.datetime(2015, 1, 6, 9, 30), ‘1/6/15 23:59’, ‘’, ‘potus’, ‘west wing’, ‘JointService Military Honor Guard’], [‘Jack T. Gutting’, ‘2014-12-18T00:00:00’, datetime.datetime(2015, 1, 6, 9, 30), ‘1/6/15 23:59’, ‘’, ‘potus’, ‘west wing’, ‘JointService Military Honor Guard’]]
As you can see, the resulting date is not returning as expected.
Anyone have an idea of what is happening? As I mentioned, the autograder is accepting the results as correct.