Opps... missing a paren there... should be:
<%= time_ago_in_words(Time.now
Mikel
Main Topics
Browse All TopicsI have a small bit of code that works out how long an enquiry has been left unattended by checking the updated_at field, and this gives me something like 87623 mins...
Is there a way I can easily convert the minutes into days and hours, maybe in the view?
P.S. this comes in an email via ActionMailer.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
I am not sure that that is what doades is asking
I would make a helper method(put it in a helper, so you can use it in the view)
If you don't like the output, you can easily change that
def minutes_to_days (min)
days = (min / (60 * 24)).floor
hours = ((min % (60 *24)) / 60).floor
minutes = min % 60
"#{days.to_s} days, #{hours.to_s} hours and #{minutes.to_s} minutes"
end
Testing the method:
puts minutes_to_days(87623)
returns
60 days, 20 hours and 23 minutes
Business Accounts
Answer for Membership
by: raasdnilPosted on 2009-01-21 at 03:28:42ID: 23428617
Given that you have your minutes in a variable called @minutes... try this in your view:
- (@minutes * 60) -%>
/classes/A ctionView/ Helpers/ Da teHelper.h tml#M00147 6
<%= time_ago_in_words(Time.now
Reference:
http://api.rubyonrails.org
Mikel