rethomics / damr

Read TriKinetics' DAM data in R
http://rethomics.github.io
6 stars 7 forks source link

query_dam2 fails if datetime not exactly correct #5

Closed pepelisu closed 7 years ago

pepelisu commented 7 years ago

I am not sure this is an issue. But I will explain it here anyway. If datatime string format for start or stop is not exact it fails. Let's for example take the string: 2017-09-10 8:00:00 will fail because the hour is missing a preceding 0. error:

Warning: 1 parsing failure.
row # A tibble: 1 x 4 col     row   col   expected             actual expected   <int> <int>      <chr>              <chr> actual 1     1    NA date like  2017-08-17 8:00:00

Error: 1 parsing failure

In the other hand this string works 2017-09-10 08:00:00. Not sure if you use excel to create the query this will happen or no.

qgeissmann commented 7 years ago

this is an issue/feature in the readr package:

readr::parse_datetime("2017-09-10 08:00:00")
#> "2017-09-10 08:00:00 UTC"
readr::parse_datetime("2017-09-10 8:00:00")
#>Warning: 1 parsing failure.
#>row # A tibble: 1 x 4 col     row   col   expected             actual expected   <int> <int>      <chr>              <chr> actual 1     1    NA date like  2017-09-10 8:00:00
#> NA

I will have a look at how it works for excel users. Maybe we can have better Warnings/errors too.

qgeissmann commented 7 years ago

maybe related to #6 () -> improve datetime parsing

qgeissmann commented 7 years ago

I am going to say #wontfix here... explicit 0 seems to be the convention: https://en.wikipedia.org/wiki/ISO_8601