aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/json
diff options
context:
space:
mode:
authorGeoff Buesing <gbuesing@gmail.com>2008-01-12 21:02:46 +0000
committerGeoff Buesing <gbuesing@gmail.com>2008-01-12 21:02:46 +0000
commit772ad9520158fb35fd5d5a9357ceca51b297bd67 (patch)
tree9595ca9aa8ff7f4df6a4163f32e014b3c177bf7b /activesupport/lib/active_support/json
parente9dad7496d8249a1487a471978d316a4360627d1 (diff)
downloadrails-772ad9520158fb35fd5d5a9357ceca51b297bd67.tar.gz
rails-772ad9520158fb35fd5d5a9357ceca51b297bd67.tar.bz2
rails-772ad9520158fb35fd5d5a9357ceca51b297bd67.zip
Time#to_json uses Numeric#to_utc_offset_s to output cross-platform-consistent representation without having to convert to DateTime. References #9750
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8636 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport/lib/active_support/json')
-rw-r--r--activesupport/lib/active_support/json/encoders/time.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/json/encoders/time.rb b/activesupport/lib/active_support/json/encoders/time.rb
index 8eb9ff132e..1636b875e3 100644
--- a/activesupport/lib/active_support/json/encoders/time.rb
+++ b/activesupport/lib/active_support/json/encoders/time.rb
@@ -1,5 +1,5 @@
class Time
def to_json(options = nil) #:nodoc:
- to_datetime.to_json(options)
+ %("#{strftime("%Y/%m/%d %H:%M:%S")} #{utc_offset.to_utc_offset_s(false)}")
end
end