On Apr 26, 2006, at 5:56 AM, Mohammad wrote:

> is it possable to do this:
> "$submit_time = Time.now
> $rfpp = 3
> $rfpp.times do
> $submit_time.hour += 1
> end"
>
> I get error because you can't add time like that, so what do I do?

First, you stop using global variables.

$ ri Time#+
----------------------------------------------------------------- Time#+
      time + numeric => time
------------------------------------------------------------------------
      Addition---Adds some number of seconds (possibly fractional) to
      time and returns that value as a new time.

         t = Time.now         #=> Wed Apr 09 08:56:03 CDT 2003
         t + (60 * 60 * 24)   #=> Thu Apr 10 08:56:03 CDT 2003

You could also check ruby-doc.org.

So:

     t = Time.now
     t += 3 * 60

-- Daniel