Skip to content
New issue

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? Sign in to your account

parse_date and parse_datetime not converting abbreviated month names #219

Closed
ryangarner opened this issue Jul 20, 2015 · 2 comments
Closed

Comments

@ryangarner
Copy link

I'm having an issue with parse_date and parse_datetime recognizing %b (abbreviated name in current locale). Do I need to change LC_TIME?

as.Date("1jan1960", "%d%b%Y")
[1] "1960-01-01"
parse_date("1jan1960", "%d%b%Y")
[1] NA
Warning message:
1 problems parsing input. See problems(...) for more details. 
strptime("1jan1960", "%d%b%Y")
[1] "1960-01-01 UTC"
parse_datetime("1jan1960", "%d%b%Y")
[1] NA
Warning message:
1 problems parsing input. See problems(...) for more details. 
sessionInfo()
R version 3.1.3 (2015-03-09)
Platform: x86_64-unknown-linux-gnu (64-bit)
Running under: CentOS release 6.6 (Final)

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8       
 [4] LC_COLLATE=en_US.UTF-8     LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                  LC_ADDRESS=C              
[10] LC_TELEPHONE=C             LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] readr_0.1.0         stringr_0.6.2       RevoUtilsMath_7.4.0 RevoUtils_7.4.0    
[5] RevoMods_7.4.0      RevoScaleR_7.4.0    lattice_0.20-30     rpart_4.1-9        

loaded via a namespace (and not attached):
[1] codetools_0.2-10 foreach_1.4.2    grid_3.1.3       iterators_1.0.7  Rcpp_0.11.5     
[6] tools_3.1.3
@hadley
Copy link
Member

hadley commented Jul 21, 2015

That's currently a known problem :/

@hadley
Copy link
Member

hadley commented Sep 3, 2015

The problem here is actually capitalisation. This works:

parse_date("1 Jan 1960", "%d %b %Y")

@hadley hadley closed this as completed in ab990b7 Sep 3, 2015
@lock lock bot locked and limited conversation to collaborators Sep 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants