最佳答案
I have a feeling there is a simple/built-in way to do this but I can't find it.
I have a duration (in seconds) in an integer and I want to display it in a friendly format.
e.g. 3600 would be displayed as "01:00:00" or "1 hour" or something.
I can do it with time_ago_in_words(Time.zone.now+3600)
but that feels like a bit of a hack, there is no reason to add/subtract from the current time just to format this value. Is there a duration_in_words()
or something?
Thanks