module ActiveSupport
  class TimeWithZone
    def as_json(options = nil)
      if ActiveSupport::JSON::Encoding.use_standard_json_time_format
        xmlschema
      else
        %(#{time.strftime("%Y/%m/%dT%H:%M:%SZ")} #{formatted_offset(false)})
      end
    end
  end
end
