@Override
    @Nullable
    public Object convert(@Nullable String value) {
        if (isNullOrEmpty(value)) {
            return null;
        }

        LOG.debug("Trying to parse date <{}> with pattern <{}>, locale <{}>, and timezone <{}>.", value, dateFormat, locale, timeZone);
        final DateTimeFormatter formatter;
        if (containsTimeZone) {
            formatter = DateTimeFormat
                    .forPattern(dateFormat)
                    .withDefaultYear(YearMonth.now(timeZone).getYear())
                    .withLocale(locale);
        } else {
            formatter = DateTimeFormat
                    .forPattern(dateFormat)
                    .withDefaultYear(YearMonth.now(timeZone).getYear())
                    .withLocale(locale)
                    .withZone(timeZone);
        }

        return DateTime.parse(value, formatter);
    }
@Test
    public void convertUsesEtcUTCIfTimeZoneSettingIsInvalid() throws Exception {
        final Converter c = new DateConverter(config("YYYY-MM-dd HH:mm:ss", "TEST", null));
        final DateTime dateTime = (DateTime) c.convert("2014-03-12 10:00:00");
        assertThat(dateTime).isEqualTo("2014-03-12T10:00:00.000Z");
    }