pandas - datetime - dropping seconds and milliseconds

Viewed 32

I have a dataframe with a datetime column. I want to retain only until minutes and drop the seconds and milliseconds.

enter image description here

How do I do this?

1 Answers

You can use this:

df['SubmitTimePst'] = pd.to_datetime(df['SubmitTimePst']).dt.strftime('%Y-%m-%d %H:%M')
Related