Method: Time#as_json

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

#as_json(options = nil) ⇒ Object

:nodoc:



201
202
203
204
205
206
207
# File 'lib/active_support/core_ext/object/json.rb', line 201

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")} #{formatted_offset(false)})
  end
end