This methods is intended to be used to get an accurate value representing
nanoseconds from the Epoch. You can use this to convert time to another
Epoch.
static VALUE
time_to_r(VALUE time)
{
struct time_object *tobj;
VALUE v;
GetTimeval(time, tobj);
v = w2v(rb_time_unmagnify(tobj->timew));
if (TYPE(v) != T_RATIONAL) {
v = rb_Rational1(v);
}
return v;
}