I tried to find where it could come from but it is not obvious.
Training of lubridate found two formats %b.%d.%Y and %b.%d.%y. lubridate:::.select_formats prioritizes the first one. Then lubridate::.striptime pass parsing through base::strptime that do not gives back NA on "apr.12.50" when used with format %b.%d.%Y. So %b.%d.%y is never used and %b.%d.%Y is used on both.
It is not the case with orders = "ymd". Difference is it uses c_parser with %y.%Om.%d and %Y.%Om.%d formats. with orders = "mdy", guess_format does not replace m with Om because of grepl("[^O][mbB]", orders)
Hope this little investigation could help fix the bug.
For dates with mixed 2- and 4-digit year, the date-parsing behavior of
parse_date_time()is inconsistent when
orders = "mdy". But, it works fine when, for example,
order = "ymd".
R version: 3.4.0
Thanks in advance.
The text was updated successfully, but these errors were encountered: