Nice date function

Hi:

you know the way the google and this forum presents dates? How it’s
measure from the current date/time and presents nicely as “39 minutes
ago”, 2 days ago, etc.? Has anyone done a gem or other library object
that I can get to do those types of dates?

Thanks so much in advance!

Mike

Have a look at DateHelper. I think the method you want is
“time_ago_in_words”.

On Jan 13, 2007, at 04:57 , Mike D. wrote:

you know the way the google and this forum presents dates? How it’s
measure from the current date/time and presents nicely as “39 minutes
ago”, 2 days ago, etc.? Has anyone done a gem or other library object
that I can get to do those types of dates?

Look up distance_of_time_ago_in_words in the Rails API reference.


Jakob S. - http://mentalized.net

There is also a seperate gem call Chronic,
http://chronic.rubyforge.org, it you ever need to use this outside of
rails.

Jake

There is also a seperate gem call Chronic,
http://chronic.rubyforge.org, it you ever need to use this outside of
rails.

Jake

OMG! How sweet is rails… You’ve got to be kidding me!

Thank you so much!

Mike

you know the way the google and this forum presents dates? How it’s
measure from the current date/time and presents nicely as “39 minutes
ago”, 2 days ago, etc.? Has anyone done a gem or other library object
that I can get to do those types of dates?

It’s builtin to Rails…

time_ago_in_words()

http://api.rubyonrails.com/classes/ActionView/Helpers/DateHelper.html#M000467

-philip

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