specify format of date in dataframe columns code example
Example 1: format date field in pandas
df['date'] = pd.to_datetime(df["date"].dt.strftime('%Y-%m'))
Example 2: apply format to pandas datetime column
formatted_df = df["Date"].dt.strftime("%m/%d/%y")