Parses the date value using the given date formats.

@param dateValue the date value to parse
@param dateFormats the date formats to use

@return the parsed date or null if input could not be parsed
345633
public static Date parseDate(final String dateValue, final String[] dateFormats) {
        return parseDate(dateValue, dateFormats, null);
    }
227695
public String getDateString(Date dateTarget, int iDateFormat)
    {
        stringBuffer.setLength(0);
        FieldPosition fieldPosition = new FieldPosition(iDateFormat);
        String string = null;
        string = dateFormat.format(dateTarget, stringBuffer, fieldPosition).toString();
        int iBegin = fieldPosition.getBeginIndex();
        int iEnd = fieldPosition.getEndIndex();
        string = string.substring(iBegin, iEnd);
        return string;
    }
746255
public static Calendar parse(String dateString) throws ValueFormatException
   {
      try
      {
         return ISO8601.parseEx(dateString);
      }
      catch (ParseException e)
      {
         throw new ValueFormatException("Can not parse date from [" + dateString + "]", e);
      }
      catch (NumberFormatException e)
      {
         throw new ValueFormatException("Can not parse date from [" + dateString + "]", e);
      }
   }
538410
private static Date parse(String dateStr, DateParser parser) {
		Assert.notNull(parser, "Parser or DateFromat must be not null !");
		Assert.notBlank(dateStr, "Date String must be not blank !");
		try {
			return parser.parse(dateStr);
		} catch (Exception e) {
			throw new DateException("Parse [{}] with format [{}] error!", dateStr, parser.getPattern(), e);
		}
	}
1060707
@Override
    public Date getConvertedValue() {
        String dateStr = this.getFirstValue();

        if (dateStr != null && !dateStr.trim().isEmpty()) {
            dateStr = dateStr.trim();
            try {
                return dateFormat.parse(dateStr);
            } catch (ParseException ex) {
                throw new UniformException(String.format("Could not parse date %s", dateStr), ex);
            }
        }

        return null;
    }
1033349
public static Date getDateParam(String name, Date defaultValue) {
		String param = getParam(name);
		return StrUtil.isBlank(param) ? defaultValue : DateUtil.parse(param);
	}
1208639
public static Date parseDate(String dateString) {
    try {
      return DATE_FORMAT.parse(dateString);
    } catch (ParseException e) {
      throw new ExchangeException("Illegal date/time format", e);
    }
  }
305058
public String stringValue(Date date) {
		String value = null;
		if (date != null) {
			SimpleDateFormat sdf = formatters.get(0);
			synchronized (sdf) {
				value = sdf.format(date);
			}
		}
		return value;
	}
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;
		}
	}
1077114
public static Date parseDate(String date, String pattern) {
        try {
            return org.apache.commons.lang.time.DateUtils.parseDate(date, new String[] {pattern});
        } catch (ParseException e) {
            return null;
        }
    }
453141
public static Calendar parse(final String date, final DateTimeFormatter format) {
		return format.parseDateTime(date).toGregorianCalendar();
	}
432627
public static DateValue toDateValue(DateValue date) {
		return (date instanceof TimeValue) ? new DateValueImpl(date.year(), date.month(), date.day()) : date;
	}
615291
public static LocalDate localDateFromString(String dateString) {
        try {
            return LocalDate.parse(dateString, DATE_FORMATTER);
        } catch (Exception e) {
            return null;
        }
    }
1347102
public DatePicker setDateFormat(String dateFormat) {
        SimpleDateFormat sdf = new SimpleDateFormat(dateFormat);
        sdf.setLenient(false);

        return setDateFormat(sdf);
    }
425431
def parse_date(self, value):
        """"""
        res = dateparser.parse(
            value, date_formats=self.options['date_formats'], languages=self.options['languages']
        )
        logger.debug("result of date parsing=%s", res)
        return res
32109
public static DateValue parseDateValue(String s, TimeZone tzid)
            throws ParseException {
        Matcher m = DATE_VALUE.matcher(s);
        if (!m.matches()) {
            throw new ParseException(s, 0);
        }
        int year = Integer.parseInt(m.group(1)),
                month = Integer.parseInt(m.group(2)),
                day = Integer.parseInt(m.group(3));
        if (null != m.group(4)) {
            int hour = Integer.parseInt(m.group(4)),
                    minute = Integer.parseInt(m.group(5)),
                    second = Integer.parseInt(m.group(6));
            boolean utc = null != m.group(7);

            DateValue dv = new DTBuilder(
                    year, month, day, hour, minute, second).toDateTime();
            if (!utc && null != tzid) {
                dv = TimeUtils.toUtc(dv, tzid);
            }
            return dv;
        } else {
            return new DTBuilder(year, month, day).toDate();
        }
    }
1113243
public static String parseFullFormat(String dateStr, String pattern, int addDays) {
        try {
            Date date = parseDate(dateStr, pattern);
            if (addDays != 0) {
                date = addDays(date, addDays);
            }
            return DateUtils.format(date, "yyyy-MM-dd HH:mm:ss");
        } catch (Exception e) {
            return null;
        }
    }