instance method Time#to_f
to_f -> Float
-
起算時からの経過秒数を浮動小数点数で返します。1 秒に満たない経過も 表現されます。
t = Time.now "%10.5f" % t.to_f #=> "1049896564.13654" t.to_i #=> 1049896564
class Time
to_f -> Float
起算時からの経過秒数を浮動小数点数で返します。1 秒に満たない経過も 表現されます。
t = Time.now "%10.5f" % t.to_f #=> "1049896564.13654" t.to_i #=> 1049896564