Actions
Bug #20334
closedTime.to_i truncates a fractional timestamp instead of rounding up
Bug #20334:
Time.to_i truncates a fractional timestamp instead of rounding up
Actions
Added by werelnon (Malcolm Patterson) over 2 years ago. Updated over 2 years ago.
It is the intended behavior.
http://ruby-doc.com/3.2.2/Time.html#class-Time-label-Epoch+Seconds
Other retrieval methods such as
Time#to_iandTime#to_f
may return a value that rounds or truncates subseconds.
Bit vague to say in the docs that to_i and to_f "may return a value that rounds or truncates". Why not just say it truncates? Regardless, I can live with it :)