Monday, 9 September 2013

Ruby Time object converted from float doesn't equal to orignial Time object

Ruby Time object converted from float doesn't equal to orignial Time object

time = Time.now
fvalue = time.to_f
return time == Time.at(fvalue)
Can somebody here explain why the above expression returns false. How can
I create a new Time object from float that matches the original time
variable?
Thanks

No comments:

Post a Comment