Does the Time#to_i
method consider leap years and any other time-related special cases when it converts a given time to seconds?
Reference: http://www.ruby-doc.org/core-2.0.0/Time.html#method-i-to_i
Does the Time#to_i
method consider leap years and any other time-related special cases when it converts a given time to seconds?
Reference: http://www.ruby-doc.org/core-2.0.0/Time.html#method-i-to_i
Leap years are of course supported. About leap seconds, I have strong doubts. While officially recognizing second range from 0 to 60 (in #sec), it seems that ruby just delegates to underlying operating system (which are in most cases not aware of leap seconds). See this link Furthermore: #to_i refers to unix epoch and does not count leap seconds, otherwise you get heavy interoperability problems between different platforms. In general, the documentation of ruby is not very precise, unfortunately.