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 behavior (at boundary) is undocumented #262
Comments
This appears to be an undocumented behavior so that it behaves like
This probably should be added to the documentation. |
I have just documented this.
You would like to have the following consistency |
Hi, @vspinu @imanuelcostigan, related to:
Can you give me some hint so that I can have a better understand the meaning of this According to my current understanding, for each date in March, no matter it's the first day or the last day, with |
Your understanding is correct. Except that second 0 is on the boundary, so ceiling will give you exact the same date for |
@vspinu Thanks for the quick response. I get your point, but I would insist on my opinion that at least for the pure I've been frustrated 3 years ago when I started using |
Hm. That you workaround fails looks like a bug.
This appeals to the intuition indeed. The problem is that it's difficult to reconcile this with the fact that we align dates to corresponding 00 second POSIX times. I doubt that this convention is enforced anywhere except truncation. Let's revisit it. Please open a new issue. I will think a bit more about a coherent semantics and will try to fix this asap. |
Thanks, I'll file a new issue later 😄 |
ceiling_date
seems to give erroneous results. Consider the following example:I expect the second result to be "2012-11-01 UTC", i.e. like the third. This is consistently wrong as seen by the fourth argument.
The problem appears to be with the following expression in
ceiling_date
:y <- floor_date(x - eseconds(1), unit)
I don't believe that there is a reason to subtract a second. Changing this to:
y <- floor_date( x, unit )
fixes the issue.
Also, I realize that the ship has probably sailed on this, but shouldn't the ceiling for a month be the last second in the month, e.g.
2012-10-31 12:59:59
rather than the first second of the following month?The text was updated successfully, but these errors were encountered: