method

to_f

v1_8_7_330 - Show latest stable - Class: Time
to_f()
public

Returns the value of time as a floating point number of seconds since epoch.

t = Time.now
"%10.5f" % t.to_f   #=> "1049896564.13654"
t.to_i              #=> 1049896564