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

vroom::col_date fails to parse %m/%d/%Y %H:%M:%S %p #170

Closed
k5cents opened this issue Jul 29, 2019 · 0 comments
Closed

vroom::col_date fails to parse %m/%d/%Y %H:%M:%S %p #170

k5cents opened this issue Jul 29, 2019 · 0 comments

Comments

@k5cents
Copy link

k5cents commented Jul 29, 2019

Potentially related to #123 (and thus #160), but vroom::col_date() seems to fail at parsing dates like 10/9/2017 10:52:01 AM

library(vroom)
packageVersion("vroom")
#> [1] '1.0.2.9000'
vroom::vroom(
  file = "x\n10/9/2017 10:52:01 AM\n",
  col_type = vroom::cols(
    x = vroom::col_date(format = "%m/%d/%Y %H:%M:%S %p")
  )
)
#> # A tibble: 1 x 1
#>   x         
#>   <date>    
#> 1 NA

Created on 2019-07-29 by the reprex package (v0.3.0)

It looks like the readr::col_date() alternative works fine.

library(readr)
packageVersion("readr")
#> [1] '1.3.1'
read_csv(
  file = "x\n10/9/2017 10:52:01 AM\n",
  col_type = readr::cols(
    x = readr::col_date(format = "%m/%d/%Y %H:%M:%S %p")
  )
)
#> # A tibble: 1 x 1
#>   x         
#>   <date>    
#> 1 2017-10-09

Created on 2019-07-29 by the reprex package (v0.3.0)

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

1 participant