From 227e1caea51279fe4687f17e5704d637a21ea15f Mon Sep 17 00:00:00 2001 From: Geoff Buesing Date: Fri, 2 Jul 2010 12:58:32 -0500 Subject: [PATCH] Time#as_json: use Time#formatted_offset instead of strftime %z directive, which is non-standard and inaccurate on some platforms (e.g., Mac OS X). [#4979] Signed-off-by: Jeremy Kemper --- activesupport/lib/active_support/json/encoding.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/activesupport/lib/active_support/json/encoding.rb b/activesupport/lib/active_support/json/encoding.rb index dbce7e710aa00..8ec3af3f504f4 100644 --- a/activesupport/lib/active_support/json/encoding.rb +++ b/activesupport/lib/active_support/json/encoding.rb @@ -212,7 +212,7 @@ def as_json(options = nil) #:nodoc: if ActiveSupport.use_standard_json_time_format xmlschema else - strftime("%Y/%m/%d %H:%M:%S %z") + %(#{strftime("%Y/%m/%d %H:%M:%S")} #{formatted_offset(false)}) end end end