1

I would like to convert this into a date:

as.POSIXct("Mar 29 2013", format = "%b %d %Y")

I read to use "%b" for abbreviated month. It seems to work for:

as.POSIXct("Apr 29 2013", format = "%b %d %Y")

I found month.abb, which might be used for checking the month abbreviation. However, it includes "Mar" as the third month.

So my question is, what is wrong with:

as.POSIXct("Mar 29 2013", format = "%b %d %Y")
Tlatwork
  • 1,445
  • 12
  • 35

1 Answers1

2

The locale would be the issue. One option would be to set the locale after checking

Sys.getlocale("LC_TIME")

If it is not English or US, then change it with Sys.setlocale

Sys.setlocale("LC_TIME", "English")
akrun
  • 874,273
  • 37
  • 540
  • 662