diff --git a/activesupport/lib/active_support/time_with_zone.rb b/activesupport/lib/active_support/time_with_zone.rb index c25c97cfa8bd8b998a50e31d54b7b68727dc2f0b..f2a2f3c3db7d4da9445121aca0107a7505b0b8e2 100644 --- a/activesupport/lib/active_support/time_with_zone.rb +++ b/activesupport/lib/active_support/time_with_zone.rb @@ -185,8 +185,11 @@ def rfc2822 end alias_method :rfc822, :rfc2822 - # :db format outputs time in UTC; all others output time in local. - # Uses TimeWithZone's +strftime+, so %Z and %z work correctly. + # Returns a string of the object's date and time. + # Accepts an optional format: + # * :default - default value, mimics Ruby 1.9 Time#to_s format. + # * :db - format outputs time in UTC :db time. See Time#to_formatted_s(:db). + # * Any key in Time::DATE_FORMATS can be used. See active_support/core_ext/time/conversions.rb. def to_s(format = :default) if format == :db utc.to_s(format)