Forum: Ruby on Rails Calculating minutes, hours or days since now

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Giant C. (Guest)
on 2007-01-24 20:16
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
Philip H. (Guest)
on 2007-01-24 20:27
(Received via mailing list)
> Is there an easy (inbuilt?) way to create the following string formats
> from dates:

time_ago_in_words

http://api.rubyonrails.com/classes/ActionView/Help...
Giant C. (Guest)
on 2007-01-24 20:29
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/Help...

Wow, that is great. Cheers.
This topic is locked and can not be replied to.