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.

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

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.