Your code is almost there.
The usage of print()
is not necessary, that is where your problem comes from.
Remove that and your code should work:
import pandas as pd
import datetime
from datetime import datetime
from datetime import time
df = pd.read_csv("C:/Users/javie/OneDrive/Escritorio/22.1.21_P1_English_Language_Y10.csv")
df[' UTC Event Timestamp'] = pd.to_datetime(df[' UTC Event Timestamp'])
df[' UTC Event Timestamp'] = df[' UTC Event Timestamp'].apply(lambda x: x.strftime('%d/%m/%Y %I:%M:%S %p'))
df.to_csv("C:/Users/javie/OneDrive/Escritorio/output.csv",index=False,date_format='%d/%m/%Y %I:%M:%S %p')
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…