Skip to content

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

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.

See also #month #next #monday? #next_day also in 4.1 · 4.0 · 3.4 · 3.3 · 3.1 · 3.0