aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/time_with_zone.rb
diff options
context:
space:
mode:
authorgbuesing <gbuesing@gmail.com>2008-04-12 16:48:56 -0500
committergbuesing <gbuesing@gmail.com>2008-04-12 16:48:56 -0500
commit7e5aa6569bc041238aafa5a400758c0a7536da93 (patch)
treedc45337259d7f44f3b91fa9a7625242b35bf133e /activesupport/lib/active_support/time_with_zone.rb
parentcfd56882af597724e427b17cdf295ffdd241dc26 (diff)
downloadrails-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/time_with_zone.rb')
-rw-r--r--activesupport/lib/active_support/time_with_zone.rb6
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 = {})