advance(options) public

Uses Date to provide precise Time calculations for years, months, and days. The options parameter takes a hash with any of these keys: :years, :months, :weeks, :days, :hours, :minutes, :seconds.

Just like Date#advance, increments are applied in order of time units from largest to smallest. This order can affect the result around the end of a month.

Show source
Register or log in to add new notes.
September 9, 2011 - (v3.0.9)
0 thanks

Example usage...

`

Time.now.advance(:days => +2, :hours => +8)

`