Method: DateTime#as_json

Defined in:
activesupport/lib/active_support/core_ext/object/json.rb

#as_json(options = nil) ⇒ Object

:nodoc:



221
222
223
224
225
226
227
# File 'activesupport/lib/active_support/core_ext/object/json.rb', line 221

def as_json(options = nil) # :nodoc:
  if ActiveSupport::JSON::Encoding.use_standard_json_time_format
    xmlschema(ActiveSupport::JSON::Encoding.time_precision)
  else
    strftime("%Y/%m/%d %H:%M:%S %z")
  end
end