private static String analyst ( String date ) { String style = null ; boolean hasDiagonal = false ; Replacer r = Replacer . of ( checkNotNull ( date ) ) ; if ( hasDiagonal = r . contain ( "/" ) ) { r . update ( r . lookups ( "/" ) . with ( "-" ) ) ; } //ISO if ( r . containAll ( "." , "T" ) ) { style = DateStyle . ISO_FORMAT ; } //CST else if ( r . contain ( "CST" ) ) { style = DateStyle . CST_FORMAT ; } //GMT else if ( r . contain ( "GMT" ) ) { style = DateStyle . GMT_FORMAT ; } //analyst else { switch ( date . length ( ) ) { case 6 : style = "HHmmss" ; break ; case 8 : style = r . contain ( ":" ) ? DateStyle . HH_mm_ss : DateStyle . yyyyMMdd ; break ; case 10 : style = DateStyle . yyyy_MM_dd ; break ; case 14 : style = DateStyle . yyyyMMddHHmmss ; break ; case 19 : style = DateStyle . yyyy_MM_dd_HH_mm_ss ; break ; } } return hasDiagonal ? r . set ( style ) . lookups ( "-" ) . with ( "/" ) : style ; }
Analyst date time string