Parses a date string.

@param dateString the date string to parse
@return a date corresponding to the given dateString, or null on error.
332668
private static Date parse(final String dateString) {
		try {
			return new SimpleDateFormat("dd/mm/yyyy").parse(dateString);
		} catch (ParseException e) {
			LOG.error("Error parsing date: " + dateString, e);
			return null;
		}
	}
155119
public static Date stringToDate(String dateString, String format) {

        return stringToDate(dateString, format, LENIENT_DATE);
    }
559960
public static Date parseDate(String date) {
        if (date == null) {
            return null;
        }
        try {
            return org.apache.commons.lang.time.DateUtils.parseDate(date, new String[] {DSP_DEFAULT_TIME_FORMAT});
        } catch (ParseException e) {
            return null;
        }
    }
1260851
@Pure
	public static Date parseDate(String xmlDate) throws DateFormatException {
		if (xmlDate == null || xmlDate.isEmpty()) {
			return null;
		}
		final SimpleDateFormat format = new SimpleDateFormat(DATE_FORMAT);
		try {
			return format.parse(xmlDate);
		} catch (Exception e) {
			//
		}
		throw new DateFormatException(xmlDate);
	}
777980
public static DateTime parseTime(String timeString) {
		timeString = normalize(timeString);
		return parse(timeString, DatePattern.NORM_TIME_FORMAT);
	}
615291
public static LocalDate localDateFromString(String dateString) {
        try {
            return LocalDate.parse(dateString, DATE_FORMATTER);
        } catch (Exception e) {
            return null;
        }
    }
223999
public void setExpirationDateString(String date) throws ParseException {
        if (StringUtils.isBlank(date)) {
            expirationDate = null;
            return;
        }

        expirationDate = dateFormat.parse(date);
    }
298619
public static Date getDay(String string) {
		if (string == null) {
			return null;
		}
		Date date = null;
		try {
			date = (new SimpleDateFormat("dd-MMM-yyyy").parse(string));
		}
		catch (ParseException ex) {
			return null;
		}
		return date;
	}
696741
public static Date parseDate(@NotNull String pattern, @NotNull String dateString) throws ParseException {
		return FastDateFormat.getInstance(pattern).parse(dateString);
	}
1144401
@CheckForNull
  public static LocalDate parseLocalDateQuietly(@Nullable String s) {
    LocalDate date = null;
    if (s != null) {
      try {
        date = parseLocalDate(s);
      } catch (RuntimeException e) {
        // ignore
      }

    }
    return date;
  }
1340455
def string_to_date(value):
    
    if isinstance(value, datetime.date):
        return value

    return dateutil.parser.parse(value).date()
491353
protected final LocalDate createLocalDate(final String dateString) {
        if (dateString == null || dateString.isEmpty()) {
            return null;
        }
        final DateParser parser = new DateParser(dateString);
        return new LocalDate(parser.getEstimateCalendar());
    }
570099
public String convertDateToString(final Date date) {
        if (date == null) {
            return null;
        }
        return dateFormat.get().format(date);
    }
128563
static Date parseDate(String dateString) {
    try {
      return DATE_FORMAT.parseDateTime(dateString).toDate();
    } catch (IllegalArgumentException e) {
      return null;
    }
  }
1357796
public static final synchronized Date parseDate(String date) {
		try {
			return dateFormat.parse(date);
		} catch(ParseException e) {
			throw new RuntimeException(e);
		}
	}
1054446
protected Object doParseValue(String formattedString, Class targetClass) throws ParseException {
		return dateFormat.parse(formattedString);
	}
1069599
def __deserialize_date(self, string):
        
        try:
            from dateutil.parser import parse
            return parse(string).date()
        except ImportError:
            return string
        except ValueError:
            raise ApiException(
                status=0,
                reason="Failed to parse `{0}` into a date object".format(string)
            )