Calculating minutes, hours or days since now

Hi,

Is there an easy (inbuilt?) way to create the following string formats
from dates:

10 minutes ago (for a date that is 10 mins old)
59 minutes ago
1 hours ago
23 hours ago
4 days ago

etc…

Thanks,
GiantCranes

Is there an easy (inbuilt?) way to create the following string formats
from dates:

time_ago_in_words

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

Philip H. wrote:

Is there an easy (inbuilt?) way to create the following string formats
from dates:

time_ago_in_words

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

Wow, that is great. Cheers.

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