How do I add two weeks to Time.now?
Ruby Date
class has methods to add days and months in addition to seconds in Time.An example:
require 'date't = DateTime.nowputs t # => 2011-05-06T11:42:26+03:00# Add 14 daysputs t + 14 # => 2011-05-20T11:42:26+03:00# Add 2 monthsputs t >> 2 # => 2011-07-06T11:42:26+03:00# And if needed, make Time object out of it(t + 14).to_time # => 2011-05-20 11:42:26 +0300