This project is archived and is in readonly mode.
Almost 1 second extra in time subtraction (rails 2.3.4)
Reported by Mina Naguib | September 15th, 2009 @ 09:00 PM
Previously, in rails 2.3.3 and earlier:
1.day.ago.end_of_day - 1.day.ago.beginning_of_day => 86399.0
However, with rails 2.3.4:
1.day.ago.end_of_day - 1.day.ago.beginning_of_day => 86399.9999990463
I believe that the old behavior is much more correct. The new behavior almost adds 1 whole second.
Comments and changes to this ticket
-
CancelProfileIsBroken September 25th, 2009 @ 12:07 PM
- Tag changed from 2.3.4, float, time, timewithzone to 2.3.4, bugmash, float, time, timewithzone
-
John Guenin September 26th, 2009 @ 09:39 PM
-1 Rails 2.3.4 adds usec to Time#end_of_day. The new value is actually more accurate.
# Rails 2.3.4 def end_of_day change(:hour => 23, :min => 59, :sec => 59, :usec => 999999.999) end # Rails 2.3.3 def end_of_day change(:hour => 23, :min => 59, :sec => 59) end
-
Blue Box Chris September 26th, 2009 @ 10:20 PM
- Rails 2.3.4 is more accurate
@@@ Ruby
Rails 2.0.5
def end_of_day
change(:hour => 23, :min => 59, :sec => 59)
end
-
Blue Box Chris September 26th, 2009 @ 10:22 PM
Pardon my terrible formatting above. The intent was.
-1 Rails 2.3.4 is more accurate
Rails 2.0.5
def end_of_daychange(:hour => 23, :min => 59, :sec => 59)
end
-
Elad Meidar September 27th, 2009 @ 12:58 AM
- Tag changed from 2.3.4, bugmash, float, time, timewithzone to 2.3.4, bugmash, bugmash-review, float, time, timewithzone
Yap, seems like the initial approach was the wrong one.
-1 on feature, i think this one should be closed too. -
Matías Flores September 27th, 2009 @ 02:51 AM
-1 The new behavior is more accurate. Actually almost a whole second was missing in 2.3.3 and below.
-
Kieran P September 27th, 2009 @ 07:01 AM
-1 In 2.3.4, you are fractionally closer to the end of the day, which is more accurate than 2.3.3.
-
CancelProfileIsBroken September 27th, 2009 @ 12:05 PM
- State changed from new to invalid
- Tag changed from 2.3.4, bugmash, bugmash-review, float, time, timewithzone to 2.3.4, float, time, timewithzone
The masses have spoken.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>
People watching this ticket
Tags
Referenced by
- 3340 Change to end_of_day causes problem with saving records In ticket #3212, it is pointed at that rails 2.3.4 change...