aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
authorVijay Dev <vijaydev.cse@gmail.com>2014-05-10 13:57:18 +0000
committerVijay Dev <vijaydev.cse@gmail.com>2014-05-10 13:57:18 +0000
commit9d5bc3c24048543d071f2c813210afa937460f14 (patch)
treeb310882d107443eddf606ba744948d9e2d774b86 /activesupport
parented56e596a0467390011bc9d56d462539776adac1 (diff)
parentffb9db0247084514adc73ae92dfe8d5a3033226b (diff)
downloadrails-9d5bc3c24048543d071f2c813210afa937460f14.tar.gz
rails-9d5bc3c24048543d071f2c813210afa937460f14.tar.bz2
rails-9d5bc3c24048543d071f2c813210afa937460f14.zip
Merge branch 'master' of github.com:rails/docrails
Diffstat (limited to 'activesupport')
-rw-r--r--activesupport/lib/active_support/time_with_zone.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/time_with_zone.rb b/activesupport/lib/active_support/time_with_zone.rb
index c25c97cfa8..f2a2f3c3db 100644
--- a/activesupport/lib/active_support/time_with_zone.rb
+++ b/activesupport/lib/active_support/time_with_zone.rb
@@ -185,8 +185,11 @@ module ActiveSupport
end
alias_method :rfc822, :rfc2822
- # <tt>:db</tt> format outputs time in UTC; all others output time in local.
- # Uses TimeWithZone's +strftime+, so <tt>%Z</tt> and <tt>%z</tt> work correctly.
+ # Returns a string of the object's date and time.
+ # Accepts an optional <tt>format</tt>:
+ # * <tt>:default</tt> - default value, mimics Ruby 1.9 Time#to_s format.
+ # * <tt>:db</tt> - format outputs time in UTC :db time. See Time#to_formatted_s(:db).
+ # * Any key in <tt>Time::DATE_FORMATS</tt> can be used. See active_support/core_ext/time/conversions.rb.
def to_s(format = :default)
if format == :db
utc.to_s(format)