I\'m trying to understand two things:
SimpleDateFormat
is not lenient)
According to the SimpleDateFormat javadoc for JDK 1.6,
For parsing, the number of pattern letters is ignored unless it's needed to separate two adjacent fields.
A look at the source code for the method that does the work, SimpleDateFormat.parse(String, ParsePosition)
, confirms this. There is a variable obeyCount
that is true if the pattern has no delimiters, like "yyyyMMdd", and false otherwise. With your pattern the parser looks for 3 numbers separated by 2 delimiters and does not care about the number of digits in each position.
The answers to your questions:
Lenient
is not a factor when delimiters are used.