Skip to content

End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →

instance method

Date#leap?

d.leap? → bool

Returns true if the year is a leap year.

Example
Date.new(2000).leap?      #=> true
Date.new(2001).leap?      #=> false
See also .leap? #ld #marshal_dump_old #julian? also in 4.1 · 4.0 · 3.4 · 3.3 · 3.2 · 3.1