Ruby 1.9.2 リファレンスマニュアル > ライブラリ一覧 > 組み込みライブラリ > Timeクラス > to_r

instance method Time#to_r

to_r -> Rational

Returns the value of <i>time</i> as a rational number of seconds since the Epoch.

t = Time.now
p t.to_r            #=> (8807170717088293/8388608)

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