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
t.to_i
Show source
/*
* call-seq:
* time.to_f => float
*
* Returns the value of <i>time</i> as a floating point number of
* seconds since epoch.
*
* t = Time.now
* "%10.5f" % t.to_f
* t.to_i
*/
static VALUE
time_to_f(time)
VALUE time;
{
struct time_object *tobj;
GetTimeval(time, tobj);
return rb_float_new((double)tobj->tv.tv_sec+(double)tobj->tv.tv_usec/1e6);
}