Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2023 11:52 PM
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
Labels:
- Labels:
-
Date Column
-
Null