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

round_date interprets secs > 60 in unexpecteed way #661

Closed
Holzhauer opened this Issue Apr 5, 2018 · 1 comment

Comments

Projects
None yet
2 participants
@Holzhauer

Holzhauer commented Apr 5, 2018

Thanks a lot for the helpful package!

x <- lubridate::ymd_hms("2009-08-03 12:01:57.11")
lubridate::round_date(x, "2 mins")
[1] "2009-08-03 12:02:00 UTC"

but

lubridate::round_date(x, "120 secs")
[1] "2009-08-03 12:01:00 UTC"

This is dangerous when handling durations e.g. in seconds, only: when the durations exceeds a minute, the result is unexpected. In this case, at least a warning should be issued.

@vspinu

This comment has been minimized.

Member

vspinu commented Apr 10, 2018

Actually truncation with seconds > 60 was never intended. So I would rather make this an error.

@vspinu vspinu closed this in 48352a6 Apr 10, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment