るりまサーチ (Ruby 2.7.0)

最速Rubyリファレンスマニュアル検索!
1件ヒット [1-1件を表示] (0.026秒)
トップページ > ライブラリ:date[x] > バージョン:2.7.0[x] > クエリ:date[x] > クエリ:next_year[x]

別のキーワード

  1. prime next
  2. _builtin next
  3. date next_day
  4. date next_month

クラス

検索結果

Date#next_year(n = 1) -> Date (105811.0)

n 年後を返します。

...相当します。

//emlist[例][ruby]{
require 'date'
Date
.new(2001,2,3).next_year #=> #<Date: 2002-02-03 ...>
Date
.new(2008,2,29).next_year #=> #<Date: 2009-02-28 ...>
Date
.new(2008,2,29).next_year(4) #=> #<Date: 2012-02-29 ...>
//}

Date
#>> も参照してください。

@param n 年...