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

ymd with Jan for month #229

Closed
mwmclean opened this issue Feb 5, 2014 · 1 comment
Closed

ymd with Jan for month #229

mwmclean opened this issue Feb 5, 2014 · 1 comment

Comments

@mwmclean
Copy link

mwmclean commented Feb 5, 2014

ymd("2004-Jan-15")  # last two digits of year seem to become month
                    # and first two digits of year seem to become last two of year
## [1] "2020-04-15 UTC"  

ymd("1904-Jan-15")
## [1] "2019-04-15 UTC"

parse_date_time("1904-Jan-15", "ybd")   # good
## [1] "1904-01-15 UTC"

ymd("1904-Feb-15")  # also good
## [1] "1904-02-15 UTC"

ymd('1920-Jan-01')  # also good (note "20" would not be a valid month)
## [1] "1920-01-01 UTC"

ymd("2004-01-01")  # also good
## [1] "2004-01-01 UTC"

sessionInfo()
## R Under development (unstable) (2013-12-21 r64500)
## Platform: x86_64-w64-mingw32/x64 (64-bit)
## 
## locale:
## [1] LC_COLLATE=English_United States.1252 
## [2] LC_CTYPE=English_United States.1252   
## [3] LC_MONETARY=English_United States.1252
## [4] LC_NUMERIC=C                          
## [5] LC_TIME=English_United States.1252    
## 
## attached base packages:
## [1] stats     graphics  grDevices utils     datasets  methods   base     
## 
## other attached packages:
## [1] lubridate_1.3.3
## 
## loaded via a namespace (and not attached):
## [1] digest_0.6.4  memoise_0.1   plyr_1.8      stringr_0.6.2
@vspinu vspinu closed this as completed in baef661 Feb 5, 2014
@vspinu
Copy link
Member

vspinu commented Feb 5, 2014

I have no idea why this issue occurs only with Jan but not with Feb. Fixed by tweaking the order of matching. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants