How do you convert a column of dates of the form "2020-06-30 15:20:13.078196+00:00" to datetime in pandas?
This is what I have done:
pd.concat([df, df.date_string.apply(lambda s: pd.Series({'date':datetime.strptime(s, '%Y-%m-%dT%H:%M:%S.%f%z')}))], axis=1)
pd.concat([df, df.file_created.apply(lambda s: pd.Series({'date':datetime.strptime(s, '%Y-%m-%dT%H:%M:%S.%f.%z')}))], axis=1)
pd.concat([df, df.file_created.apply(lambda s: pd.Series({'date':datetime.strptime(s, '%Y-%m-%dT%H:%M:%S.%f:%z')}))], axis=1)
I get the error - time data '2020-06-30 15:20:13.078196+00:00' does not match format
in all cases.
Any help is appreciated.