I tried to convert a column that has this string "12/03/23 09:43 AM"
df_site['RECEIVE DATE'] = pd.to_datetime(df_site['RECEIVE DATE'], format='%Y:%b:%d')
but I get this format "2023-12-03 09:43:00" and that is wrong.
I need this format YYYY-DD-MM
I tried to convert a column that has this string "12/03/23 09:43 AM"
df_site['RECEIVE DATE'] = pd.to_datetime(df_site['RECEIVE DATE'], format='%Y:%b:%d')
but I get this format "2023-12-03 09:43:00" and that is wrong.
I need this format YYYY-DD-MM
Copyright © 2021 Jogjafile Inc.
pd.to_datetime follows the American convention when the format is ambiguous, where month is written before date. You can specify the format explicitly to make the format unambiguous