Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upIncorrect parsing of Mon-Year (bY) format #559
Comments
|
Base function library(lubridate)
#>
#> Attachement du package : 'lubridate'
#> The following object is masked from 'package:base':
#>
#> date
old <- Sys.getlocale("LC_TIME")
Sys.setlocale("LC_TIME", "eng")
#> [1] "English_United Kingdom.1252"
strptime("May-2010", format="%b-%Y")
#> [1] NA
strptime("10-May-2010", format="%d-%b-%Y")
#> [1] "2010-05-10 CEST"If we use parse_date_time("May-2010", orders="OmY")
#> [1] "2010-05-01 UTC" |
|
This should be working. Our C parser handles English months but for some reasons "bY" is not getting through. > parse_date_time2("May-2010", orders="bY")
[1] "2010-05-01 UTC"
> parse_date_time(c("01-May-2010", "May-2010", "2010"), orders=c("dbY", "bY", "Y"))
[1] "2010-05-01 UTC" "2010-01-01 UTC" "2010-01-01 UTC"
|
|
Thanks Christophe, Using Thanks for your responses, Ido |
Hi,
I'm trying to parse a very simple date format, which appears as either
%d-%b-%Y,%b-%Yor%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.