From: Logan Capaldo Date: 2006-04-26T13:13:04+09:00 Subject: Re: Adding time On Apr 25, 2006, at 11:56 PM, 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? > > > -- > Posted via http://www.ruby-forum.com/. > one_hour = 60 * 60 # sixty seconds per minute, 60 minutes to an hour old_submit_time = $submit_time $submit_time = Time.at($submit_time.to_i + one_hour) if old_submit_time.hour + 1 == $submit_time.hour puts "Yay!" end