String format = "yyyyMMdd";
SimpleDateFormat formatter = getSimpleDateFormat(format);
formatter.setLenient(false);
Date date = formatter.parse("07312011",new ParsePosition(0));
System.out.println(date);
This gives "2500-01-01 00:00:00" on jdk1.4 which is incorrect and returns null on jdk1.5
Why does this give "2500-01-01 00:00:00" on jdk1.4? If it is not able to parse a date, does it default to this date?
UPDATE:
I know that if i use 20110731 it works... But if i pass 07312011, it gives some random date in 1.4 and null in 1.5 So, my questions are
In 1.4, if the passed date does does not correspond to the format, does it default to 2500-01-01?
Why does it return null on 1.5?