Attempts to parse the given string into a java.util.Date using the provided
input formats.

@param dateString a date string in one of the acceptable formats.
@throws ParseException if the date is not in one of the input formats.
439487
public Date parse(String dateString)
	throws ParseException
	{
		Date result = null;
		ParseException lastException = null;
		
		for (DateFormat format : inputFormats)
		{
			try
			{
				result = ((DateFormat) format.clone()).parse(dateString);	// DateFormat is not thread safe.
				lastException = null;
				break;
			}
			catch (ParseException e)
			{
				// Keep the first exception that occurred.
				if (lastException == null)
				{
					lastException = e;
				}
				// And just try the next input format.
			}
		}

		if (lastException != null)
		{
			throw lastException;
		}

		return result;
	}
1054446
protected Object doParseValue(String formattedString, Class targetClass) throws ParseException {
		return dateFormat.parse(formattedString);
	}
442132
function parseDateString (dateString) {
  // Pass through when a native object is sent
  if (dateString instanceof Date) {
    return dateString
  }
  // Caste string to date object
  if (String(dateString).match(matchers)) {
    // If looks like a milisecond value cast to number before
    // final casting (Thanks to @msigley)
    if (String(dateString).match(/^[0-9]*$/)) {
      dateString = Number(dateString)
    }
    // Replace dashes to slashes
    if (String(dateString).match(/-/)) {
      dateString = String(dateString).replace(/-/g, '/')
    }
    return new Date(dateString)
  } else {
    throw new Error('Couldn\'t cast `' + dateString +
      '` to a date object.')
  }
}
328421
@Override
    public void setAsText(String text) throws IllegalArgumentException {
        if (this.allowEmpty && !StringUtils.hasText(text)) {
            // Treat empty String as null value.
            setValue(null);
        } else {
            try {
                if (this.dateFormat != null)
                    setValue(this.dateFormat.parse(text));
                else {
                    setValue(DateUtils.parse(text));
                }
            } catch (ParseException ex) {
                throw new IllegalArgumentException("Could not parse date: " + ex.getMessage(), ex);
            }
        }
    }
6002
public static Calendar dateStringToCalendar(String dateString) {
        Calendar calendar = Calendar.getInstance();
        SimpleDateFormat formatter = new SimpleDateFormat(XLinkConstants.DATEFORMAT);
        try {
            calendar.setTime(formatter.parse(dateString));
        } catch (Exception ex) {
            return null;
        }
        return calendar;
    }
1108091
public static Date decodeDate(String value) throws ParseException {
        String javaValue = value.substring(0, value.length() - 3) + value.substring(value.length() - 2);
        SimpleDateFormat dateFormatter = new SimpleDateFormat(dateFormat);
        return dateFormatter.parse(javaValue);
    }
345633
public static Date parseDate(final String dateValue, final String[] dateFormats) {
        return parseDate(dateValue, dateFormats, null);
    }
591089
public void setDateFormatString(String dfString) {
		for (int i = 0; i < 4; i++) {
			((JDateChooser) components[i]).setDateFormatString(dfString);
		}
	}
158920
public Date parseDate(String str) {
        if (str == null)
            return null;
        try {
            return dateFormat.parse(str);
        } catch (ParseException e) {
            throw new RuntimeException(e);
        }
    }
704142
public static String formatDateString(String dateString, String format1, String format2) {
        if (dateString == null) {
            return null;
        }
        java.text.SimpleDateFormat beforeFormat = new java.text.SimpleDateFormat(format1);
        java.text.SimpleDateFormat endFormat = new java.text.SimpleDateFormat(format2);
        try {
            return endFormat.format(beforeFormat.parse(dateString));
        } catch (ParseException e) {
            e.printStackTrace();
            return dateString;
        }
    }
518271
public static String getStringFromISODateString(String dateISOString) {
        Date date;
        String formattedDate;
        DateFormat formatter = getFormatter();
        try {
            date = formatter.parse(dateISOString);
            formattedDate = DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.SHORT).format(date);
        } catch (ParseException e) {
            logger.log(Level.WARNING, e.getMessage(), e);
            formattedDate = dateISOString;
        }
        return formattedDate;
    }
155119
public static Date stringToDate(String dateString, String format) {

        return stringToDate(dateString, format, LENIENT_DATE);
    }
988125
def _parse_date(self, date_string):
        """"""
        date = datetime.strptime(date_string, self._DATE_FORMAT)
        self.date = self._TZ.localize(date).astimezone(pytz.UTC)
369084
@Override
    protected Time parseString(final DateFormat formatter, final String text) throws ParseException {
        Date date = formatter.parse(text);
        Calendar cal = Calendar.getInstance();
        cal.setTime(date);
        cal.set(1899, 12-1, 31);

        return convertTypeValue(cal.getTime());
    }
211733
public Date toDate(String dateString) {
        Date date = null;
        DateFormat df = new SimpleDateFormat("yyyy-MM-dd");
        try {
            date = df.parse(dateString);
        } catch (ParseException ex) {
            System.out.println(ex.fillInStackTrace());
        }
        return date;
    }
284686
public static String getDateString(String format, Date date) {
        SimpleDateFormat sdf = new SimpleDateFormat(format);
        return sdf.format(date);
    }
1126643
public static String getStringFromDateTime(Date date) throws ParseException {
        SimpleDateFormat formatter = new SimpleDateFormat(DATE_yyyyMMddTHHmmssSSSZone);
        return formatter.format(date);
    }