includes/org/apache/poi/ss/usermodel/DateUtil.java
public static boolean isADateFormat(int formatIndex, String formatString) {
        // First up, is this an internal date format?
        if(isInternalDateFormat(formatIndex)) {
            return true;
        }

        // If we didn't get a real string, it can't be
        if(formatString == null || formatString.length() == 0) {
            return false;
        }

        String fs = formatString;
        StringBuilder sb = new StringBuilder(fs.length());
        for (int i = 0; i < fs.length(); i++) {
            char c = fs.charAt(i);
            if (i < fs.length() - 1) {
                char nc = fs.charAt(i + 1);
                if (c == '\\') {
                    switch (nc) {
                        case '-':
                        case ',':
                        case '.':
                        case ' ':
                        case '\\':
                            // skip current '\' and continue to the next char
                            continue;
                    }
                } else if (c == ';' && nc == '@') {
                    i++;
                    // skip ";@" duplets
                    continue;
                }
            }
            sb.append(c);
        }
        fs = sb.toString();
        
        // If it starts with [$-...], then could be a date, but
        //  who knows what that starting bit is all about
        fs = date_ptrn1.matcher(fs).replaceAll("");
        // If it starts with something like [Black] or [Yellow],
        //  then it could be a date
        fs = date_ptrn2.matcher(fs).replaceAll("");
        // You're allowed something like dd/mm/yy;[red]dd/mm/yy
        //  which would place dates before 1900/1904 in red
        // For now, only consider the first one
        if(fs.indexOf(';') > 0 && fs.indexOf(';') < fs.length()-1) {
           fs = fs.substring(0, fs.indexOf(';'));
        }

        // Otherwise, check it's only made up, in any case, of:
        //  y m d h s - \ / , . :
        // optionally followed by AM/PM
        return date_ptrn3.matcher(fs).matches();
    }
/**
     * Given a format ID and its format String, will check to see if the
     *  format represents a date format or not.
     * Firstly, it will check to see if the format ID corresponds to an
     *  internal excel date format (eg most US date formats)
     * If not, it will check to see if the format string only contains
     *  date formatting characters (ymd-/), which covers most
     *  non US date formats.
     *
     * @param formatIndex The index of the format, eg from ExtendedFormatRecord.getFormatIndex
     * @param formatString The format string, eg from FormatRecord.getFormatString
     * @see #isInternalDateFormat(int)
     */
Given a format ID and its format String, will check to see if the
format represents a date format or not.
Firstly, it will check to see if the format ID corresponds to an
internal excel date format
If not, it will check to see if the format string only contains
date formatting characters (ymd-/), which covers most
non US date formats.

@param formatIndex The index of the format, eg from ExtendedFormatRecord.getFormatIndex
@param formatString The format string, eg from FormatRecord.getFormatString
@see #isInternalDateFormat(int)
Given a format ID and its format String will check to see if the format represents a date format or not . Firstly it will check to see if the format ID corresponds to an internal excel date format If not it will check to see if the format string only contains date formatting characters ( ymd - / ) which covers most non US date formats . @param formatIndex The index of the format eg from ExtendedFormatRecord . getFormatIndex @param formatString The format string eg from FormatRecord . getFormatString @see #isInternalDateFormat ( int )
public static boolean isADateFormat(int formatIndex, String formatString) {
        if(isInternalDateFormat(formatIndex)) {
            return true;
        }
        if(formatString == null || formatString.length() == 0) {
            return false;
        }
        String fs = formatString;
        StringBuilder sb = new StringBuilder(fs.length());
        for (int i = 0; i < fs.length(); i++) {
            char c = fs.charAt(i);
            if (i < fs.length() - 1) {
                char nc = fs.charAt(i + 1);
                if (c == '\\') {
                    switch (nc) {
                        case '-':
                        case ',':
                        case '.':
                        case ' ':
                        case '\\':
                            continue;
                    }
                } else if (c == ';' && nc == '@') {
                    i++;
                    continue;
                }
            }
            sb.append(c);
        }
        fs = sb.toString();
        fs = date_ptrn1.matcher(fs).replaceAll("");
        fs = date_ptrn2.matcher(fs).replaceAll("");
        if(fs.indexOf(';') > 0 && fs.indexOf(';') < fs.length()-1) {
           fs = fs.substring(0, fs.indexOf(';'));
        }
        return date_ptrn3.matcher(fs).matches();
    }
public static boolean isADateFormat ( int formatIndex , String formatString ) { if ( isInternalDateFormat ( formatIndex ) ) { return true ; } if ( formatString == null || formatString . length ( ) == 0 ) { return false ; } String fs = formatString ; StringBuilder sb = new StringBuilder ( fs . length ( ) ) ; for ( int i = 0 ; i < fs . length ( ) ; i ++ ) { char c = fs . charAt ( i ) ; if ( i < fs . length ( ) - 1 ) { char nc = fs . charAt ( i + 1 ) ; if ( c == '\\' ) { switch ( nc ) { case '-' : case ',' : case '.' : case ' ' : case '\\' : continue ; } } else if ( c == ';' && nc == '@' ) { i ++ ; continue ; } } sb . append ( c ) ; } fs = sb . toString ( ) ; fs = date_ptrn1 . matcher ( fs ) . replaceAll ( "" ) ; fs = date_ptrn2 . matcher ( fs ) . replaceAll ( "" ) ; if ( fs . indexOf ( ';' ) > 0 && fs . indexOf ( ';' ) < fs . length ( ) - 1 ) { fs = fs . substring ( 0 , fs . indexOf ( ';' ) ) ; } return date_ptrn3 . matcher ( fs ) . matches ( ) ; }
Given a format ID and its format String, will check to see if the
  format represents a date format or not.
Given a format ID and its format String will check to see if the format represents a date format or not .
// First up, is this an internal date format?
 // If we didn't get a real string, it can't be
 // skip current '\' and continue to the next char
 // skip ";@" duplets
 // If it starts with [$-...], then could be a date, but
 //  who knows what that starting bit is all about
 // If it starts with something like [Black] or [Yellow],
 //  then it could be a date
 // You're allowed something like dd/mm/yy;[red]dd/mm/yy
 //  which would place dates before 1900/1904 in red
 // For now, only consider the first one
 // Otherwise, check it's only made up, in any case, of:
 //  y m d h s - \ / , . :
 // optionally followed by AM/PM
