Class | DateTime |
In: |
vendor/rails/activesupport/lib/active_support/json/encoders/date_time.rb
vendor/rails/activesupport/lib/active_support/core_ext/date_time.rb |
Parent: | Object |
Returns a JSON string representing the datetime.
DateTime.civil(2005,2,1,15,15,10).to_json # => "2005/02/01 15:15:10 +0000"
# File vendor/rails/activesupport/lib/active_support/json/encoders/date_time.rb, line 7 7: def to_json(options = nil) 8: if ActiveSupport.use_standard_json_time_format 9: xmlschema.inspect 10: else 11: %("#{strftime("%Y/%m/%d %H:%M:%S %z")}") 12: end 13: end