I need to do this: If Time.now is: => Fri Mar 21 18:19:14 +0100 2008 I want to obatain 7 days more, like: => Fri Mar 28 18:19:14 +0100 2008 So I can then compare this two dates. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
> I need to do this: > If Time.now is: > > => Fri Mar 21 18:19:14 +0100 2008 > > I want to obatain 7 days more, like: > > => Fri Mar 28 18:19:14 +0100 2008 > > So I can then compare this two dates.>> Time.now + 7.days=> Fri Mar 28 10:24:29 -0700 2008>> 7.days.from_now=> Fri Mar 28 10:24:36 -0700 2008 --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On Mar 21, 2008, at 1:21 PM, John Smith wrote:> > I need to do this: > If Time.now is: > > => Fri Mar 21 18:19:14 +0100 2008 > > I want to obatain 7 days more, like: >7.days.from_now> > => Fri Mar 28 18:19:14 +0100 2008 > > So I can then compare this two dates.or: today = Time.now 7.days.since(today) today + 7.days -Rob Rob Biedenharn http://agileconsultingllc.com Rob-xa9cJyRlE0mWcWVYNo9pwxS2lgjeYSpx@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---