-
Notifications
You must be signed in to change notification settings - Fork 100
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
Hour 24 to_s issue #142
Comments
I think the issue lies with Ruby's
I'm not too familiar with the internals of the I've noticed that there's also a difference in whether t1 = Time.new(2022, 11, 6, 24, 0, 0)
[t1.year, t1.month, t1.day, t1.hour]
# => [2022, 11, 7, 0] <== converted to hour 0 on the next day
tz = TZInfo::Timezone.get("America/Chicago")
t2 = Time.new(2022, 11, 6, 24, 0, 0, tzinfo=tz)
[t2.year, t2.month, t2.day, t2.hour]
# => [2022, 11, 6, 24] <== values left as supplied It's probably best to raise this on the Ruby Issue Tracking System. |
Thank you for looking into this. I've added an issue #19106 to the ruby issue tracking system. I'll ask to reopen should it get kicked back this way. |
Not sure which module is responsible but there appears to be a bug when using Time with tzinfo and setting hour to 24.
All the string outputs above should match (first two depends on your system timezone). The inconsistent issue appears to happen when using Time with hour = 24 and with tzinfo set.
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x64-mingw-ucrt]
tzinfo (2.0.5, 2.0.4)
tzinfo-data (1.2022.1)
The text was updated successfully, but these errors were encountered: