We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Adding seconds returns NAs when result has new hour and zero seconds
library(lubridate) ymd_hms("2015-01-01 00:59:00") + seconds(60) ## [1] NA ymd_hms("2015-01-01 01:59:00") + seconds(60) ## [1] NA ymd_hms("2015-01-01 23:59:00") + seconds(60) ## [1] NA ymd_hms("2015-01-01 00:59:05") + seconds(55) ## [1] NA ymd_hms("2015-01-01 00:59:59") + seconds(1) ## [1] NA
Doing the equivalent with minutes(1) works
minutes(1)
ymd_hms("2015-01-01 00:59:00") + minutes(1) ## [1] "2015-01-01 01:00:00 UTC" ymd_hms("2015-01-01 01:59:00") + minutes(1) ## [1] "2015-01-01 02:00:00 UTC" ymd_hms("2015-01-01 23:59:00") + minutes(1) ## [1] "2015-01-02 UTC"
NA only occurs when result has new hour and zero seconds
ymd_hms("2015-01-01 00:59:00") + seconds(59) ## [1] "2015-01-01 00:59:59 UTC" ymd_hms("2015-01-01 00:59:00") + seconds(61) ## [1] "2015-01-01 01:00:01 UTC" ymd_hms("2015-01-01 00:58:00") + seconds(60) ## [1] "2015-01-01 00:59:00 UTC"
NA does not occur when adding more than 60 seconds to create new hour and zero seconds
ymd_hms("2015-01-01 00:58:59") + seconds(61) ## [1] "2015-01-01 01:00:00 UTC" ymd_hms("2015-01-01 00:58:55") + seconds(65) ## [1] "2015-01-01 01:00:00 UTC" ymd_hms("2015-01-01 23:58:00") + seconds(120) ## [1] "2015-01-02 UTC"
The text was updated successfully, but these errors were encountered:
This bug is probably related to what was reported in issue #217.
Sorry, something went wrong.
7941df8
No branches or pull requests
Adding seconds returns NAs when result has new hour and zero seconds
Doing the equivalent with
minutes(1)
worksNA only occurs when result has new hour and zero seconds
NA does not occur when adding more than 60 seconds to create new hour and zero seconds
The text was updated successfully, but these errors were encountered: