Question

Like the title says,

>as.Date("06/10/2013", "%m/%d/%y") # returns "2020-06-2013
[1] "2020-06-10"

What is causing this? I'm using windows with 32-bit RGui and the latest zoo package.

Thanks.

Was it helpful?

Solution

Because %y is not %Y:

R> as.Date("06/10/2013", "%m/%d/%Y")   # note capital-Y
[1] "2013-06-10"
R> 
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top