How to correct date column?

I have date column like September 9, 2019 and I want to convert it to 9-9-2019 or 9/9/2019
day, month and year.

I would do it in two steps, first making a date from the initial string and then converting it to a string of the desired format.

AsDate <- mdy("September 9, 2019")
format(AsDate, "%m/%d/%Y")
[1] "09/09/2019"
1 Like