private String convertTimestamp ( ) { //some locales (for example, French) generate timestamp text with characters not included in \w - // now using \S (all non-whitespace characters) instead of /w String result = timestampFormat . replaceAll ( VALID_DATEFORMAT_CHAR_PATTERN + "+" , "\\\\S+" ) ; //make sure dots in timestamp are escaped result = result . replaceAll ( Pattern . quote ( "." ) , "\\\\." ) ; return result ; }
Helper method that will convert timestamp format to a pattern