Converting the mon-yy format to date, but showing null for output

vicks
New Contributor III

I have a date column that comes with month-year format and I am trying to convert that into dd-mm-yyyy format in pyspark

for example I have date column with value

Jan-2019

Feb-2020

Mar-2020

the output I am expecting is

01/01/2019

01/02/2020

01/03/2020

here is he code I have written but that comes with null values

df2 = input_df.withColumn("mon-yr",to_date(col("mon-yr"),"MM/dd/yyyy"))

df2.show()

any help is appreciated

Thank you,

Vicks