rdate

Convert "xx-xxx-xxxx" to date in R


I want to convert strings such as "19-SEP-2022" to date. Is there any available function in R? Thank you.


Solution

  • This is a solution that uses the base R function as.Date:

    as.Date("19-SEP-2022","%d-%b-%Y")