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

ceiling_date() on a daylight savings boundary #1173

Open
eheinzen opened this issue Nov 4, 2024 · 1 comment
Open

ceiling_date() on a daylight savings boundary #1173

eheinzen opened this issue Nov 4, 2024 · 1 comment

Comments

@eheinzen
Copy link

eheinzen commented Nov 4, 2024

Both 1 am CST and 1 am CDT result in 1 am CDT when running ceiling_date(, "hour"). I would expect 1 am CST to round to 1 am CST, and 1 am CDT to round to 1 am CDT.

> packageVersion("lubridate")
[1] ‘1.9.3’
> as_datetime("2024-11-03T01:00:00-0600", tz = "America/Chicago") %>% ceiling_date("hour")
Date in ISO8601 format; converting timezone from UTC to "America/Chicago".
[1] "2024-11-03 01:00:00 CDT"
> as_datetime("2024-11-03T01:00:00-0500", tz = "America/Chicago") %>% ceiling_date("hour")
Date in ISO8601 format; converting timezone from UTC to "America/Chicago".
[1] "2024-11-03 01:00:00 CDT"

In other words, I would not expect this to happen:

> x <- as_datetime("2024-11-03T01:00:00-0600", tz = "America/Chicago")
Date in ISO8601 format; converting timezone from UTC to "America/Chicago".
> ceiling_date(x, "hour") >= x
[1] FALSE
@hersheyk
Copy link

hersheyk commented Nov 8, 2024

I don't know if this would solve your problem but a similar issue seems to have been mentioned in Issue #640

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