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
  • 155,156
  • 41
  • 207
  • 295
mlzboy
  • 13,836
  • 23
  • 73
  • 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,613
  • 2
  • 58
  • 69