This cant be so hard but feeling rather annoyed with myself for thinking I
can do the following:

DateTime.now + 1.day

... and getting the expected result, which would *not* be (but is):

ruby-1.8.7-p330 :055 > DateTime.now + 1.day
 => #<DateTime 2247-11-04T13:24:19-05:00>

Or

ruby-1.8.7-p330 :056 > DateTime.now + 120.minutes
 => #<DateTime 2030-12-31T13:25:01-05:00>

(btw, the date on my computer is correct =~  => #<DateTime
2011-04-15T13:25:17-05:00>)

Is there any easy way to do this?

I also see people saying to use Time instead of DateTime, and that it is
possible to do:

Time.now + 10.days

and get the expected output but in my case I get:

Time.now + 10.days
NoMethodError: undefined method `advance' for #<Date 2011-04-15>

ActiveSupport is loaded though....

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to