This is with 3.5 beta 5. in org.apache.poi.ss.usermodel.DateUtil.isADateFormat() The following regular expression is used for the judgment whether CellStyle.getDataFormatString() is a Date format or not. fs.matches("^[yYmMdDhHsS\\-/,. :]+[ampAMP/]*$") // line 239 However, For instance, the following marks are generally prepared as a built-in format in the Japanese version Excel, which are NOT recognized as Date format. yyyy"年"m"月";@ m"月"d"日";@ I think that you should check it by the regular expression after removing the part enclosed with "" so that localized format can be recognized as Date format. like this ------------- // And '"any"' into '' while( fs.contains("\"")){ int beginIdx = fs.indexOf("\""); if( beginIdx == -1){ break; } int endIdx = fs.indexOf( "\"", beginIdx + 1); if( endIdx == -1){ break; } fs = fs.replaceFirst( fs.substring( beginIdx, endIdx + 1),""); }
Any chance you could upload a sample file with one of the problem formatting rules, and a failing unit test?
Created attachment 23527 [details] The format of A-1 and A-2 cells is Japanese Date format. The format of A-1 and A-2 cells is Japanese Date format.