Format time as "______ ago"

a lot of bloggy sites display time as this post was made X hours / X
days / X months ago. this is so popular I’m sure RoR has a built in
lib to do it, but I can’t figure it out, searching google and the
docs. there’s an ago function, but it returns a Time. I need like
the reverse. Is there one?

On Dec 11, 2007, at 12:32 PM, rubynuby wrote:

a lot of bloggy sites display time as this post was made X hours / X
days / X months ago. this is so popular I’m sure RoR has a built in
lib to do it, but I can’t figure it out, searching google and the
docs. there’s an ago function, but it returns a Time. I need like
the reverse. Is there one?

time_ago_in_words

http://api.rubyonrails.org/classes/ActionView/Helpers/DateHelper.html#M000994

-Rob

Rob B. http://agileconsultingllc.com
[email protected]

thank you :slight_smile:

On Dec 11, 2007, at 11:32 AM, rubynuby wrote:

a lot of bloggy sites display time as this post was made X hours / X
days / X months ago. this is so popular I’m sure RoR has a built in
lib to do it, but I can’t figure it out, searching google and the
docs. there’s an ago function, but it returns a Time. I need like
the reverse. Is there one?

distance_of_time_in_words

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs