From ca9413674ea70dc67ab517734af2e40dac21beef Mon Sep 17 00:00:00 2001 From: Pratik Naik Date: Wed, 26 Mar 2008 12:27:52 +0000 Subject: Improve documentation. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9093 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activesupport/lib/active_support/json/encoders/time.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'activesupport/lib/active_support/json/encoders/time.rb') diff --git a/activesupport/lib/active_support/json/encoders/time.rb b/activesupport/lib/active_support/json/encoders/time.rb index 4f964a92e0..b0c9189c78 100644 --- a/activesupport/lib/active_support/json/encoders/time.rb +++ b/activesupport/lib/active_support/json/encoders/time.rb @@ -1,5 +1,10 @@ class Time - def to_json(options = nil) #:nodoc: + # Returns a JSON string representing the time. + # + # ==== Example: + # Time.utc(2005,2,1,15,15,10).to_json + # # => 2005/02/01 15:15:10 +0000" + def to_json(options = nil) %("#{strftime("%Y/%m/%d %H:%M:%S")} #{formatted_offset(false)}") end end -- cgit v1.2.3