Good Question it seems to work for me in Rails 2.0.1:
>> Time.now.beginning_of_week.advance({ :minutes => 15 }).asctime
=> "Mon Dec 10 00:15:00 2007"
On Dec 13, 4:27 pm, Michael Kohout
<mwkoh...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> Hello all-I''m a new Ruby developer(but longtime java developer),
and
> I''m having trouble getting Time to work for me.
>
> With a ''base'' date as Monday of this week:
> Time.now.beginning_of_week.asctime
> => "Mon Dec 10 00:00:00 2007"
>
> I can advance days without problems>>
Time.now.beginning_of_week.advance({ :days=> 15 } )
>
> => Tue Dec 25 00:00:00 -0600 2007
>
> but if I try to advance minutes, my code fails silently:>>
Time.now.beginning_of_week.advance({ :minutes=> 15 } ).asctime
>
> Time.now.beginning_of_week.advance({ :minutes=> 15 } ).asctime
> => "Mon Dec 10 00:00:00 2007"
>
> Any ideas on what I''m doing wrong? I''m on Rails 1.2.6
--~--~---------~--~----~------------~-------~--~----~
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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---