Hi,
Can someone explain to me why the following does not throw a ParseException:
public class DateFormatTest {
public static void main(String[] args) {
// yyMMdd
String dtString = "100504";
java.text.DateFormat df = new java.text.SimpleDateFormat("MMddyyyy");
df.setLenient(false);
try {
java.util.Date dt = df.parse(dtString);
System.out.println(dtString +" parsed: "+ dt);
} catch(java.text.ParseException e) {
e.printStackTrace();
}
}
}
Since DateFormat is using "MMddyyyy", the date string I'm passing in is only 6 bytes, and I'm setting lenient to false, it seems like parse() should throw a ParseException. Does anyone know what I'm missing?
Thank you.