to_i()
Returns the value of time as an integer number of seconds since the Epoch.
t = Time.now "%10.5f" % t.to_f #=> "1049896564.17839" t.to_i #=> 1049896564
static VALUE time_to_i(VALUE time) { struct time_object *tobj; GetTimeval(time, tobj); return LONG2NUM(tobj->ts.tv_sec); }