require "date" # # dates = (Date.parse("2020/01/01")..Date.parse("2020/01/04")).to_a # pp dates # # => [#, # # #, # # #, # # #] puts (Date.parse("2015/01/01")..Date.parse("2015/12/31")).count { _1.month == _1.day + _1.day }