Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and
privacy statement. We’ll occasionally send you account related emails.
Already on GitHub?
to your account
a <- c("2013-1-1", "2013-0-1")
b <- "2013-0-1"
The text was updated successfully, but these errors were encountered:
Ugh, sorry about the formatting. Didn't look like that in the "preview". Can't seem to edit it now.
Sorry, something went wrong.
"2013-0-1" is not a date, is it? Where did you get it from?
It works by accident because the underlying C parser is a bit relaxed about the 0s in a couple of places. The format detection is rigorous, though, and this is why your b vector fails.
So your point is to make the parser fail on a right? Or make it work on b?
Correct, "2013-0-1" is not a date, and I would expect the parser to fail on it. I got it by doing paste(x$year, x$month, x$day, sep = "-") on dirty data that had a zero in the month column.
paste(x$year, x$month, x$day, sep = "-")
Thanks for all the lubridate functions that do work, by the way, they save me hours every week.
Successfully merging a pull request may close this issue.