Add day to datetime field

The version is elasticsearch-6.5.4

This is the complete error

{
  "error": {
    "root_cause": [
      {
        "type": "script_exception",
        "reason": "runtime error",
        "script_stack": [
          "java.time.format.DateTimeFormatter.parseResolved0(DateTimeFormatter.java:1949)",
          "java.time.format.DateTimeFormatter.parse(DateTimeFormatter.java:1851)",
          "java.time.OffsetDateTime.parse(OffsetDateTime.java:402)",
          "java.time.OffsetDateTime.parse(OffsetDateTime.java:387)",
          "ctx._source['evg_fecha_creacion'] = OffsetDateTime.parse(ctx._source['created_at']).withDayOfMonth(28)",
          "                                                                    ^---- HERE"
        ],
        "script": "ctx._source['created_at'] = OffsetDateTime.parse(ctx._source['created_at']).withDayOfMonth(28)",
        "lang": "painless"
      }
    ],
    "type": "script_exception",
    "reason": "runtime error",
    "script_stack": [
      "java.time.format.DateTimeFormatter.parseResolved0(DateTimeFormatter.java:1949)",
      "java.time.format.DateTimeFormatter.parse(DateTimeFormatter.java:1851)",
      "java.time.OffsetDateTime.parse(OffsetDateTime.java:402)",
      "java.time.OffsetDateTime.parse(OffsetDateTime.java:387)",
      "ctx._source['created_at'] = OffsetDateTime.parse(ctx._source['created_at']).withDayOfMonth(28)",
      "                                                            ^---- HERE"
    ],
    "script": "ctx._source['created_at'] = OffsetDateTime.parse(ctx._source['created_at']).withDayOfMonth(28)",
    "lang": "painless",
    "caused_by": {
      "type": "date_time_parse_exception",
      "reason": "Text '2018-12-27 08:01:20' could not be parsed at index 10"
    }
  },
  "status": 500
}

I have made your example and throws this error.

{
  "error": {
    "root_cause": [
      {
        "type": "illegal_argument_exception",
        "reason": "cannot write xcontent for unknown value of type class java.time.OffsetDateTime"
      }
    ],
    "type": "illegal_argument_exception",
    "reason": "cannot write xcontent for unknown value of type class java.time.OffsetDateTime"
  },
  "status": 400
}