Ruby run time to nanoseconds:
now = Time.zone.now => Wed, 19 Feb 2014 21:30:56 UTC +00:00 Time.zone.at(now.to_f) => Wed, 19 Feb 2014 21:30:56 UTC +00:00 now == Time.zone.at(now.to_f) => false
But if you compare nanoseconds, you will see that they do not match even when creating a time object using the float value, since the float used to create a new time object is not as accurate as the nanosecond time value:
now.nsec => 956134961 Time.zone.at(now.to_f).nsec => 956134796
source share