+(p1)
public
Addition—Adds some number of seconds (possibly fractional) to
time and returns that value as a new time.
t = Time.now
t + (60 * 60 * 24)
Show source
/*
* call-seq:
* time + numeric => time
*
* Addition---Adds some number of seconds (possibly fractional) to
* <i>time</i> and returns that value as a new time.
*
* t = Time.now
* t + (60 * 60 * 24)
*/
static VALUE
time_plus(time1, time2)
VALUE time1, time2;
{
struct time_object *tobj;
GetTimeval(time1, tobj);
if (TYPE(time2) == T_DATA && RDATA(time2)->dfree == time_free) {
rb_raise(rb_eTypeError, "time + time?");
}
return time_add(tobj, time2, 1);
}