public Object convert(Class destClass, Object srcObj) {
        Calendar result = new GregorianCalendar();
        Class srcFieldClass = srcObj.getClass();
        // Convert from Date to Calendar
        if (java.util.Date.class.isAssignableFrom(srcFieldClass)) {
            result.setTime((java.util.Date)srcObj);
        } else if (Calendar.class.isAssignableFrom(srcFieldClass)) {
            //  Convert from Calendar to Calendar
            Calendar c = (Calendar)srcObj;
            result.setTime(c.getTime());
            result.setTimeZone(c.getTimeZone());
        } else if (XMLGregorianCalendar.class.isAssignableFrom(srcFieldClass)) {
            Calendar c = ((XMLGregorianCalendar)srcObj).toGregorianCalendar();
            result.setTime(c.getTime());
            result.setTimeZone(c.getTimeZone());
        } else if (dateFormat != null && String.class.isAssignableFrom(srcFieldClass)) {
            // String to Calendar
            try {
                result.setTime(new Date(dateFormat.parse((String)srcObj).getTime()));
            } catch (ParseException e) {
                throw new ConversionException("Unable to parse source object using specified date format", e);
            }
        } else {
            // Default conversion
            try {
                result.setTime(new Date(Long.parseLong(srcObj.toString())));
            } catch (NumberFormatException e) {
                throw new ConversionException("Unable to determine time in millis of source object", e);
            }
        }

        // Calendar to String
        if (dateFormat != null && String.class.isAssignableFrom(destClass)) {
            return dateFormat.format(result.getTime());
        }

        return result;
    }
Internal class for converting Supported Data Types to Calendar. Supported source data types include Date, Calendar,
String, Objects that return a long from their toString(). Only intended for internal use.
core/src/main/java/com/github/dozermapper/core/converters/CalendarConverter.java