You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to parse a very simple date format, which appears as either %d-%b-%Y, %b-%Y or %Y. parse_date_time() works great for the 1st and 3rd formats, but is unable to parse the second one (though guess_date() successfully guesses the right format).
Examples:
> parse_date_time("May-2010", orders="bY")
[1] NA
Warning message:
All formats failed to parse. No formats found.
> guess_formats("May-2010", orders="bY")
bY
"%b-%Y"
> parse_date_time("May-2010", orders="%b-%Y")
[1] NA
Warning message:
All formats failed to parse. No formats found.
> parse_date_time("May-2010", orders="Y")
[1] "2010-01-01 UTC"
> parse_date_time("01-May-2010", orders="dbY")
[1] "2010-05-01 UTC"
I'm using R 3.3.1, with lubridate 1.6.0, on a Windows machine with "English_Australia.1252" locale.
The text was updated successfully, but these errors were encountered:
Using Om instead of b worked for me and parsed correctly all the appearances, using orders=c("dOmY", "OmY", "Y"), so I'll go with that for now.
Vitalie, using parse_date_time2("May-2010", orders="bY") worked alright, but only when I know in advance the format to expect and it is not flexible to "guess" when the input of mixed formats.
Hi,
I'm trying to parse a very simple date format, which appears as either
%d-%b-%Y
,%b-%Y
or%Y
.parse_date_time()
works great for the 1st and 3rd formats, but is unable to parse the second one (thoughguess_date()
successfully guesses the right format).Examples:
I'm using R 3.3.1, with lubridate 1.6.0, on a Windows machine with "English_Australia.1252" locale.
The text was updated successfully, but these errors were encountered: