Ruby - DateTime
Revision as of 08:51, 19 March 2010 by PeterHarding (talk | contribs) (Created page with '=Methods= ==>>(n) Method== From http://ruby-doc.org/core/classes/Date.src/M000677.html <pre> # File lib/date.rb, line 1273 def >> (n) y, m = (year * 12 + (mon - 1) + n)....')
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