Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR RUBY

rails date humanize

datetime.to_formatted_s(:db)            # => "2007-12-04 00:00:00"
datetime.to_formatted_s(:short)         # => "04 Dec 00:00"
datetime.to_formatted_s(:long)          # => "December 04, 2007 00:00"
datetime.to_formatted_s(:long_ordinal)  # => "December 4th, 2007 00:00"
datetime.to_formatted_s(:rfc822)        # => "Tue, 04 Dec 2007 00:00:00 +0000"
datetime.to_formatted_s(:iso8601)       # => "2007-12-04T00:00:00+00:00"
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #rails #date #humanize
ADD COMMENT
Topic
Name
6+1 =