code: private static int getMillis(String dateStr) {
  		int length = dateStr.length();
  		if (length == 19) {
  			// "1999-12-31 12:34:56", no milli second left
  			return 0;
  		} else if (length == 21) {
  			// "1999-12-31 12:34:56.7", return 7
  			return Integer.parseInt(dateStr.substring(20)) * 100;
  		} else if (length == 22) {
  			// "1999-12-31 12:34:56.78", return 78
  			return Integer.parseInt(dateStr.substring(20)) * 10;
  		} else if (length >= 23 && length <= 26) {
  			// "1999-12-31 12:34:56.123" ~ "1999-12-31 12:34:56.123456"
  			return Integer.parseInt(dateStr.substring(20, 23)) * 10;
  		} else {
  			return 0;
  		}
  	}
docs: Returns the milli second part of the datetime.