Pandas datetime error when reading from excel file
Using pandas, first make sure you have a datetime column:

df['DT'] = pd.to_datetime(df['DT'])


To remove the milliseconds, a possible solution is to use round to obtain a specified frequency (in this case seconds).

df['DT'] = df['DT'].dt.round(freq='s')


Depending on the wanted final result, ceil (to always round up) or floor (always round down) could be more suitable.