to_r

time.to_r â a_rational
Instance Public methods

Returns the value of time as a rational number of seconds since the Epoch.

t = Time.now
p t.to_r            #=> (1270968792716287611/1000000000)

This methods is intended to be used to get an accurate value representing the nanoseconds since the Epoch. You can use this method to convert time to another Epoch.

doc_ruby_on_rails
2015-05-17 22:11:31
Comments
Leave a Comment

Please login to continue.