Created
July 2, 2011 02:25
-
-
Save ezkl/1059685 to your computer and use it in GitHub Desktop.
distance_of_time_ago & time_ago_in_words
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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