Trovit/src/main/java/org/openestate/io/trovit/TrovitUtils.java
public static Calendar parseDateValue(String value) {
        value = StringUtils.trimToNull(value);
        if (value == null) return null;

        final String[] patterns = new String[]{
                "dd/MM/yyyy",
                "dd/MM/yyyy hh:mm:ss",
                "dd-MM-yyyy",
                "dd-MM-yyyy hh:mm:ss",
                "yyyy/MM/dd",
                "yyyy/MM/dd hh:mm:ss",
                "yyyy-MM-dd",
                "yyyy-MM-dd hh:mm:ss"
        };

        try {
            Date date = DateUtils.parseDateStrictly(value, Locale.ENGLISH, patterns);
            Calendar cal = Calendar.getInstance(Locale.getDefault());
            cal.setTime(date);
            return cal;
        } catch (ParseException ex) {
            throw new IllegalArgumentException("Can't parse date value '" + value + "'!", ex);
        }
    }
public static Calendar parseDateValue(String value) {
        value = StringUtils.trimToNull(value);
        if (value == null) return null;

        final String[] patterns = new String[]{
                "dd/MM/yyyy",
                "dd/MM/yyyy hh:mm:ss",
                "dd-MM-yyyy",
                "dd-MM-yyyy hh:mm:ss",
                "yyyy/MM/dd",
                "yyyy/MM/dd hh:mm:ss",
                "yyyy-MM-dd",
                "yyyy-MM-dd hh:mm:ss"
        };

        try {
            Date date = DateUtils.parseDateStrictly(value, Locale.ENGLISH, patterns);
            Calendar cal = Calendar.getInstance(Locale.getDefault());
            cal.setTime(date);
            return cal;
        } catch (ParseException ex) {
            throw new IllegalArgumentException("Can't parse date value '" + value + "'!", ex);
        }
    }
public static Calendar parseDateValue ( String value ) { value = StringUtils . trimToNull ( value ) ; if ( value == null ) return null ; final String [ ] patterns = new String [ ] { "dd/MM/yyyy" , "dd/MM/yyyy hh:mm:ss" , "dd-MM-yyyy" , "dd-MM-yyyy hh:mm:ss" , "yyyy/MM/dd" , "yyyy/MM/dd hh:mm:ss" , "yyyy-MM-dd" , "yyyy-MM-dd hh:mm:ss" } ; try { Date date = DateUtils . parseDateStrictly ( value , Locale . ENGLISH , patterns ) ; Calendar cal = Calendar . getInstance ( Locale . getDefault ( ) ) ; cal . setTime ( date ) ; return cal ; } catch ( ParseException ex ) { throw new IllegalArgumentException ( "Can't parse date value '" + value + "'!" , ex ) ; } }
Read a {@link Calendar} value from XML.

@param value XML string
@return parsed value or null, if the value is invalid
Read a { @link Calendar } value from XML .