1

I used the code below to return a number, but it's not human readable. How do I convert it to a x hours x mins x second format?

ruby-1.9.2-p0 > Time.now.end_of_day() -Time.now
 => 31612.235963075 
the Tin Man
  • 158,662
  • 42
  • 215
  • 303
mlzboy
  • 14,343
  • 23
  • 76
  • 97
  • 4
    possible duplicate of [How to generate a human readable time range using ruby on rails ](http://stackoverflow.com/questions/4136248/how-to-generate-a-human-readable-time-range-using-ruby-on-rails) – Mladen Jablanović Nov 25 '10 at 08:06

1 Answers1

4

Use distance_of_time_in_words(Time.now, Time.now.end_of_day)

edgerunner
  • 14,873
  • 2
  • 57
  • 69