code: private static long parseToTimeMillis(String dateStr, TimeZone tz) {
  		String format;
  		if (dateStr.length() <= 10) {
  			format = DATE_FORMAT_STRING;
  		} else {
  			format = TIMESTAMP_FORMAT_STRING;
  		}
  		return parseToTimeMillis(dateStr, format, tz) + getMillis(dateStr);
  	}
docs: Parses a given datetime string to milli seconds since 1970-01-01 00:00:00 UTC
  using the default format "yyyy-MM-dd" or "yyyy-MM-dd HH:mm:ss" depends on the string length.