private static final String TIMESTAMP_PATTERN = "^\\d{4}\\-\\d{2}\\-\\d{2}\\s\\d{2}:\\d{2}:\\d{2}\\.\\d{3}$";
private static Pattern pattern = Pattern.compile(TIMESTAMP_PATTERN);
String timestamp = "yyyy-mm-dd hh:MM:ss.SSS";
//判断timestamp格式是否正确: yyyy-mm-dd hh:MM:ss.SSS
Matcher m = pattern.matcher(timestamp);
//如果timestamp格式不正确, 则抛异常
if(!m.find())
{
LOGGER.info( "timestamp格式不正确!");
}