File: //usr/local/rvm/gems/ruby-2.7.4/doc/activesupport-6.1.4.1/ri/DateTime/to_formatted_s-i.ri
U:RDoc::AnyMethod[iI"to_formatted_s:ETI"DateTime#to_formatted_s;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"RConvert to a formatted string. See Time::DATE_FORMATS for predefined formats.;To:RDoc::Markup::BlankLine o;
; [I"-This method is aliased to <tt>to_s</tt>.;T@S:RDoc::Markup::Heading:
leveli: textI"
Examples;To:RDoc::Markup::Verbatim; [I"_datetime = DateTime.civil(2007, 12, 4, 0, 0, 0, 0) # => Tue, 04 Dec 2007 00:00:00 +0000
;TI"
;TI"Hdatetime.to_formatted_s(:db) # => "2007-12-04 00:00:00"
;TI"Hdatetime.to_s(:db) # => "2007-12-04 00:00:00"
;TI"Cdatetime.to_s(:number) # => "20071204000000"
;TI"Adatetime.to_formatted_s(:short) # => "04 Dec 00:00"
;TI"Ldatetime.to_formatted_s(:long) # => "December 04, 2007 00:00"
;TI"Mdatetime.to_formatted_s(:long_ordinal) # => "December 4th, 2007 00:00"
;TI"Tdatetime.to_formatted_s(:rfc822) # => "Tue, 04 Dec 2007 00:00:00 +0000"
;TI"Ndatetime.to_formatted_s(:iso8601) # => "2007-12-04T00:00:00+00:00"
;T:@format0S;;
i;I"7Adding your own datetime formats to to_formatted_s;To;
; [ I"HDateTime formats are shared with Time. You can add your own to the ;TI"FTime::DATE_FORMATS hash. Use the format name as the hash key and ;TI"Deither a strftime string or Proc instance that takes a time or ;TI"$datetime argument as the value.;T@o;; [I"+# config/initializers/time_formats.rb
;TI"3Time::DATE_FORMATS[:month_and_year] = '%B %Y'
;TI"fTime::DATE_FORMATS[:short_ordinal] = lambda { |time| time.strftime("%B #{time.day.ordinalize}") };T;0:
@fileI"9lib/active_support/core_ext/date_time/conversions.rb;T:0@omit_headings_from_table_of_contents_below000[[I" to_s;To;; [ ;@-;0I"(format = :default);T@-FI"
DateTime;TcRDoc::NormalClass00