End of Life Ruby 3.2 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
Date#new_start
new_start(start = Date::ITALY]) → new_date
ext/date/date_core.c
View on GitHub ↗
static VALUE
d_lite_new_start(int argc, VALUE *argv, VALUE self)
{
VALUE vsg;
double sg;
rb_scan_args(argc, argv, "01", &vsg);
sg = DEFAULT_SG;
if (argc >= 1)
val2sg(vsg, sg);
return dup_obj_with_new_start(self, sg);
}
Returns a copy of self with the given start value:
Example
d0 = Date.new(2000, 2, 3) d0.julian? # => false d1 = d0.new_start(Date::JULIAN) d1.julian? # => true
See argument start.