succ()
public
Returns a new Time object, one second later than time. Time#succ is obsolete since 1.9.2 for time is
not a discrete value.
t = Time.now
t.succ
Use instead time + 1
t + 1
Show source
VALUE
rb_time_succ(VALUE time)
{
struct time_object *tobj;
struct time_object *tobj2;
rb_warn("Time#succ is obsolete; use time + 1");
GetTimeval(time, tobj);
time = time_new_timew(rb_cTime, wadd(tobj->timew, WINT2FIXWV(TIME_SCALE)));
GetTimeval(time, tobj2);
TZMODE_COPY(tobj2, tobj);
if (TZMODE_LOCALTIME_P(tobj2) && maybe_tzobj_p(tobj2->vtm.zone)) {
zone_localtime(tobj2->vtm.zone, time);
}
return time;
}