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
Updated by nobu (Nobuyoshi Nakada) over 2 years ago
- Status changed from Open to Feedback
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.
Updated by werelnon (Malcolm Patterson) over 2 years ago
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 :)
Actions