[Rails] Re: How to convert a "time difference" into "x days, y hours..."

2010-04-11 Thread Tom Ha
Great! Thanks a lot, guys! -- 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-t...@googlegroups.com. To unsubscribe from this group, send email to r

[Rails] Re: How to convert a "time difference" into "x days, y hours..."

2010-04-11 Thread Frederick Cheung
On Apr 11, 4:48 pm, Tom Ha wrote: > Hi there, > > how can I convert something like... > >   future_datetime - past_datetime  (which results in a float) > > into something like... > >   "21 days, 2 hours, 53 minutes, 1 seconds" ? > Have a look at distance_of_time_in_words http://api.rubyonrails.