Home > Back-end >  Timestamp datetime64 to datetime in dataframe
Timestamp datetime64 to datetime in dataframe

Time:03-15

I am confused with datetime64 and trying convert it to a normal time format.

I have a column with timestamp format: 2022.01.02D23:10:12.197164900.

Output expected is: 2022-01-02 23:10:12

I'm trying with:

df['executionTime'] = pd.to_datetime(df['executionTime'], format='%Y-%m-%d %H:%M:%S.%f', errors='coerce')

CodePudding user response:

Try this:

df['executionTime'] = pd.to_datetime(df['executionTime'], format='%Y.%m.           
  • Related