Permalink
Browse files

Time#as_json: use Time#formatted_offset instead of strftime %z direct…

…ive, which is non-standard and inaccurate on some platforms (e.g., Mac OS X).

[#4979]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
  • Loading branch information...
1 parent aeaa468 commit 227e1caea51279fe4687f17e5704d637a21ea15f @gbuesing gbuesing committed with jeremy Jul 2, 2010
Showing with 1 addition and 1 deletion.
  1. +1 −1 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

0 comments on commit 227e1ca

Please sign in to comment.