0

I have date variables in the following format: "01OCT2018". I would like the output to be in the following format: "2018-10-01". In the documentation of strptime() it says that %b is the "abbreviated month name in the current locale". Therefore, since my default locale is de_DE_UTF-8 (Germany), I get the following:

strptime("01OCT2018", format = "%d%b%Y") # NA

strptime("01OKT2018", format = "%d%b%Y") # "2018-10-01 GMT"

However, changing my locale using Sys.setlocale("LC_ALL", locale = "en_US_UTF-8") does not change the results of the above calls. Is there any other way I can override the default locale or maybe an even simpler solution to my problem?

nhoeft
  • 535
  • 6
  • 17

0 Answers0