diff options
author | gbuesing <gbuesing@gmail.com> | 2008-04-12 16:48:56 -0500 |
---|---|---|
committer | gbuesing <gbuesing@gmail.com> | 2008-04-12 16:48:56 -0500 |
commit | 7e5aa6569bc041238aafa5a400758c0a7536da93 (patch) | |
tree | dc45337259d7f44f3b91fa9a7625242b35bf133e /activesupport/lib/active_support | |
parent | cfd56882af597724e427b17cdf295ffdd241dc26 (diff) | |
download | rails-7e5aa6569bc041238aafa5a400758c0a7536da93.tar.gz rails-7e5aa6569bc041238aafa5a400758c0a7536da93.tar.bz2 rails-7e5aa6569bc041238aafa5a400758c0a7536da93.zip |
TimeWithZone respects config.active_support.use_standard_json_time_format
Diffstat (limited to 'activesupport/lib/active_support')
-rw-r--r-- | activesupport/lib/active_support/time_with_zone.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/time_with_zone.rb b/activesupport/lib/active_support/time_with_zone.rb index b91480cd48..1c984f07d4 100644 --- a/activesupport/lib/active_support/time_with_zone.rb +++ b/activesupport/lib/active_support/time_with_zone.rb @@ -77,7 +77,11 @@ module ActiveSupport alias_method :iso8601, :xmlschema def to_json(options = nil) - %("#{time.strftime("%Y/%m/%d %H:%M:%S")} #{formatted_offset(false)}") + if ActiveSupport.use_standard_json_time_format + utc.xmlschema.inspect + else + %("#{time.strftime("%Y/%m/%d %H:%M:%S")} #{formatted_offset(false)}") + end end def to_yaml(options = {}) |