I'm trying to convert a string in this format 12 Mar 1995
in a datetime object. I'm using the as.Date
function, it works pretty well but, if I try to convert the string 18 Dec 1856
the function returns me NA. I tried changing different parts of the string and I discovered that some month abbreviation do not work. For instance, if I try to convert 18 Dec 1856
or 18 Jul 1856
it doesn't work, but if I want to convert 18 Mar 1956
or 18 May 1956
it works. What am I doing wrong?
Here is the code that I'm using:
myDate="18 Dec 1956"
as.Date(myDate, format="%d %b %Y")