Is their a method within rails that if you pass it a DateTime it returns that amount of days that have passed since then in the today, yesterday, 2 days ago, etc format. I could of sworn I say a method that did that. Thanks -- John Kopanas john-Iau1QiYlxLpBDgjK7y7TUQ@public.gmane.org http://www.kopanas.com http://www.cusec.net http://www.soen.info --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
John Kopanas wrote:> Is their a method within rails that if you pass it a DateTime it > returns that amount of days that have passed since then in the today, > yesterday, 2 days ago, etc format. I could of sworn I say a method > that did that. > > Thanks > > -- > John Kopanas > john-Iau1QiYlxLpBDgjK7y7TUQ@public.gmane.org > > http://www.kopanas.com > http://www.cusec.net > http://www.soen.infothis? time_ago_in_words(from_time, include_seconds = false) http://api.rubyonrails.org/classes/ActionView/Helpers/DateHelper.html#M000572 -- 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 -~----------~----~----~----~------~----~------~--~---
John Kopanas wrote:> Is their a method within rails that if you pass it a DateTime it > returns that amount of days that have passed since then in the today, > yesterday, 2 days ago, etc format. I could of sworn I say a method > that did that. >There''s since, from_now, etc here: http://api.rubyonrails.com/classes/ActiveSupport/CoreExtensions/Numeric/Time.html or Chronic does a good job: http://rubyforge.org/projects/chronic/ Would love if it could do business day translation :-) Screencast: http://podcast.sdruby.com/podcasts/008_chronic.m4v -- 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 -~----------~----~----~----~------~----~------~--~---
Perfect... thanks :-) On 1/28/07, David Coleman <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > John Kopanas wrote: > > Is their a method within rails that if you pass it a DateTime it > > returns that amount of days that have passed since then in the today, > > yesterday, 2 days ago, etc format. I could of sworn I say a method > > that did that. > > > > There''s since, from_now, etc here: > http://api.rubyonrails.com/classes/ActiveSupport/CoreExtensions/Numeric/Time.html > > or > > Chronic does a good job: http://rubyforge.org/projects/chronic/ > Would love if it could do business day translation :-) > > Screencast: http://podcast.sdruby.com/podcasts/008_chronic.m4v > > > -- > Posted via http://www.ruby-forum.com/. > > > >-- John Kopanas john-Iau1QiYlxLpBDgjK7y7TUQ@public.gmane.org http://www.kopanas.com http://www.cusec.net http://www.soen.info --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---