Screen Link:
https://app.dataquest.io/m/403/working-with-dates-and-times-in-python/5/using-strptime-to-parse-strings-as-dates
My Code:
date_format = "%m/%d/%y %H:%M"
for row in potus:
start_date = row[2]
start_date = dt.datetime.strptime(start_date, date_format)
row[2] = start_date
What I expected to happen:
date_1_str = “24/12/1984”
date_1_dt = dt.datetime.strptime(date_1_str, “%d/%m/%Y”)
print(type(date_1_dt))
print(date_1_dt)
class ‘datetime.datetime’
1984-12-24 00:00:00
What actually happened:
[['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'],