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
Apologies if this is a repeated issue, this seems slightly different from other DST bugs I saw reported.
library(lubridate) #> #> Attaching package: 'lubridate' #> The following object is masked from 'package:base': #> #> date x <- ymd_hms("2017-11-05 23:59:03", tz = 'America/New_York') x #> [1] "2017-11-05 23:59:03 EST" ceiling_date(x, 'day') #> [1] "2017-11-05 23:00:00 EST"
The issue arises in round.r line 253 when a "days" worth of seconds is added to 2017-11-05.
2017-11-05
Because of DST ending, 2017-11-05 has 25 hours but ceiling_date(x, 'day') only adds 86400 seconds (24 hours).
ceiling_date(x, 'day')
86400
y <- floor_date(x, 'day') # Not what I expected, but accurate y + 86400 #> [1] "2017-11-05 23:00:00 EST" # What I expected, seems accurate y + days(1) #> [1] "2017-11-06 EST" # What I expected, but not accurate? y + hours(24) #> [1] "2017-11-06 EST" # Hacky work-around floor_date(x, 'day') + days(1) #> [1] "2017-11-06 EST" # Same for 2016, 2015... ceiling_date(ymd_hm('2016-11-06 23:59', tz = 'America/New_York'), 'day') #> [1] "2016-11-06 23:00:00 EST" ceiling_date(ymd_hm('2015-11-01 23:59', tz = 'America/New_York'), 'day') #> [1] "2015-11-01 23:00:00 EST" # DST is overrated ¯\_(ツ)_/¯
The text was updated successfully, but these errors were encountered:
Thanks for the identification. An update is needed there indeed.
Sorry, something went wrong.
c061796
No branches or pull requests
Apologies if this is a repeated issue, this seems slightly different from other DST bugs I saw reported.
The issue arises in round.r line 253 when a "days" worth of seconds is added to
2017-11-05
.Because of DST ending, 2017-11-05 has 25 hours but
ceiling_date(x, 'day')
only adds86400
seconds (24 hours).The text was updated successfully, but these errors were encountered: