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

between function bug for datetime/date mix #6183

Closed
abdellah19jan opened this issue Feb 10, 2022 · 1 comment · Fixed by #6260
Closed

between function bug for datetime/date mix #6183

abdellah19jan opened this issue Feb 10, 2022 · 1 comment · Fixed by #6260
Labels
bug an unexpected problem or unintended behavior funs 😆

Comments

@abdellah19jan
Copy link

between(ymd_hms("2022-02-15 00:00:00"), ymd("2022-02-01"), ymd("2022-02-28"))
Returns FALSE
between(as_date(ymd_hms("2022-02-15 00:00:00")), ymd("2022-02-01"), ymd("2022-02-28"))
Returns TRUE

@hadley hadley added bug an unexpected problem or unintended behavior funs 😆 labels Apr 15, 2022
@hadley
Copy link
Member

hadley commented Apr 15, 2022

Reprex:

library(dplyr, warn.conflicts = FALSE)

jan1 <- as.Date("2022-01-01")
jan2 <- as.Date("2022-01-02")
jan3 <- as.Date("2022-01-03")

between(jan2, jan1, jan3)
#> [1] TRUE
between(as.POSIXct(jan2), jan1, jan3)
#> [1] FALSE

Created on 2022-04-15 by the reprex package (v2.0.1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug an unexpected problem or unintended behavior funs 😆
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants