to_f()
public
Returns the value of time as a floating point number of seconds
since the Epoch.
t = Time.now
"%10.5f" % t.to_f
t.to_i
Note that IEEE 754 double is not accurate enough to represent the number of
nanoseconds since the Epoch.
Show source
static VALUE
time_to_f(VALUE time)
{
struct time_object *tobj;
GetTimeval(time, tobj);
return rb_Float(rb_time_unmagnify_to_float(tobj->timew));
}