Skip to content

Instantly share code, notes, and snippets.

@ezkl ezkl/gist:1059685
Created Jul 2, 2011

Embed
What would you like to do?
distance_of_time_ago & time_ago_in_words
ruby-1.9.2-p180 :018 > class Ack
ruby-1.9.2-p180 :019?> include ActionView::Helpers::DateHelper
ruby-1.9.2-p180 :020?> end
=> Ack
ruby-1.9.2-p180 :021 > dh = Ack.new
=> #<Ack:0x00000101dfb018>
ruby-1.9.2-p180 :022 > dh.time_ago_in_words("2011-05-05 19:49:46")
=> "about 1 month"
ruby-1.9.2-p180 :023 > dh.distance_of_time_in_words_to_now("2011-05-05 19:49:46")
=> "about 1 month"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.