Skip to content

Maintenance Ruby 3.3 gets fixes, but no new features. Switch to Ruby 4.0 →

instance method

Date#next

d.next → new_date

Returns a new Date object representing the following day:

Example
d = Date.new(2001, 2, 3)
d.to_s      # => "2001-02-03"
d.next.to_s # => "2001-02-04"
See also #new_start #next_day #month #next_month also in 4.1 · 4.0 · 3.4 · 3.2 · 3.1 · 3.0