public static DateTime convertToDateTime(@Nonnull Object value) {
        if (value instanceof DateTime) {
            return (DateTime) value;
        }

        if (value instanceof Date) {
            return new DateTime(value, DateTimeZone.UTC);
        } else if (value instanceof ZonedDateTime) {
            final DateTimeZone dateTimeZone = DateTimeZone.forTimeZone(TimeZone.getTimeZone(((ZonedDateTime) value).getZone()));
            return new DateTime(Date.from(((ZonedDateTime) value).toInstant()), dateTimeZone);
        } else if (value instanceof OffsetDateTime) {
            return new DateTime(Date.from(((OffsetDateTime) value).toInstant()), DateTimeZone.UTC);
        } else if (value instanceof LocalDateTime) {
            final LocalDateTime localDateTime = (LocalDateTime) value;
            final ZoneId defaultZoneId = ZoneId.systemDefault();
            final ZoneOffset offset = defaultZoneId.getRules().getOffset(localDateTime);
            return new DateTime(Date.from(localDateTime.toInstant(offset)));
        } else if (value instanceof LocalDate) {
            final LocalDate localDate = (LocalDate) value;
            final LocalDateTime localDateTime = localDate.atStartOfDay();
            final ZoneId defaultZoneId = ZoneId.systemDefault();
            final ZoneOffset offset = defaultZoneId.getRules().getOffset(localDateTime);
            return new DateTime(Date.from(localDateTime.toInstant(offset)));
        } else if (value instanceof Instant) {
            return new DateTime(Date.from((Instant) value), DateTimeZone.UTC);
        } else if (value instanceof String) {
            return ES_DATE_FORMAT_FORMATTER.parseDateTime((String) value);
        } else {
            throw new IllegalArgumentException("Value of invalid type <" + value.getClass().getSimpleName() + "> provided");
        }
    }
@Test
    void convertFromOffsetDateTimeWithNonUTCOffset() {
        final OffsetDateTime input = OffsetDateTime.of(2021, 11, 20, 14, 50, 10, 0, ZoneOffset.of("+1"));

        final DateTime output = DateTimeConverter.convertToDateTime(input);

        final DateTime expectedOutput = new DateTime(2021, 11, 20, 13, 50, 10, DateTimeZone.UTC);
        assertThat(output).isEqualTo(expectedOutput);
    }