class DateTimeFormatterUtil {

    public static Object stringToZonedDateTime(String value, String dateFormat, ZoneId defaultTimeZone)
    {
        try {
            ZonedDateTime zdt = ZonedDateTime.parse(value);
            logger.info("Parsed {} to ZonedDateTime {}", value, zdt.toString());
            return zdt;
        }
        catch (DateTimeParseException e) {
            logger.warn("Unable to parse {} as ZonedDateTime type due to invalid date format, " +
                    "Falling back to LocalDateTime using timezone {}", value, defaultTimeZone);
        }
        return stringToDateTime(value, dateFormat, defaultTimeZone);
    }

    private  DateTimeFormatterUtil();

}