Ruby - DateTime
Jump to navigation
Jump to search
Methods
>>(n) Method
From http://ruby-doc.org/core/classes/Date.src/M000677.html
# File lib/date.rb, line 1273 def >> (n) y, m = (year * 12 + (mon - 1) + n).divmod(12) m, = (m + 1) .divmod(1) d = mday d -= 1 until jd2 = self.class.valid_civil?(y, m, d, fix_style) self + (jd2 - jd) end