Your're right! as soon as I implemented it I noticed the seconds change. 
I just came up with the number of seconds in a day and used that.  I 
would be nice if it were as simple in ruby as it is in rails, but I know 
speed is more important and ease of use.....usually.

A LeDonne wrote:
> On 1/29/06, charlie bowman <cbowmanschool / yahoo.com> wrote:
>> Thanks, I had no idea that it was so simple in Ruby!
>>
>>
>> today = Time.now
>> puts (today - 7)
> 
> Careful!
> 
> If you're using Time, you're subtracting SECONDS:
> irb(main):001:0> today = Time.now
> => Mon Jan 30 00:11:51 EST 2006
> irb(main):002:0> puts( today - 7 )
> Mon Jan 30 00:11:44 EST 2006
> => nil
> 
> That's why I included the " require 'date' " in my example, and
> suggested that you could use DateTime if you needed times.


-- 
Posted via http://www.ruby-forum.com/.