Javadoc
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@905267 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
1c5b51d6a6
commit
381cb097a8
|
@ -306,6 +306,21 @@ public class DateUtils {
|
|||
return parseDateWithLeniency(str, parsePatterns, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>Parses a string representing a date by trying a variety of different parsers.</p>
|
||||
*
|
||||
* <p>The parse will try each parse pattern in turn.
|
||||
* A parse is only deemed successful if it parses the whole of the input string.
|
||||
* If no parse patterns match, a ParseException is thrown.</p>
|
||||
*
|
||||
* @param str the date to parse, not null
|
||||
* @param parsePatterns the date format patterns to use, see SimpleDateFormat, not null
|
||||
* @param lenient Specify whether or not date/time parsing is to be lenient.
|
||||
* @return the parsed date
|
||||
* @throws IllegalArgumentException if the date string or pattern array is null
|
||||
* @throws ParseException if none of the date patterns were suitable
|
||||
* @see java.util.Calender#isLenient()
|
||||
*/
|
||||
private static Date parseDateWithLeniency(String str, String[] parsePatterns,
|
||||
boolean lenient) throws ParseException {
|
||||
if (str == null || parsePatterns == null) {
|
||||
|
|
Loading…
Reference in New Issue