Using jdk1.7.0_55, I'm getting parseposition.errorIndex as 0 in case of timezone is not standard one.
But using jdk1.6.0_38 I'm getting parseposition.errorIndex as 21 for the same wrong timezone format
Below is the sample:
String date = "13 Jan 2005 21:45:34 ABC";
String format = "dd MMM yyyy HH:mm:ss z";
ParsePosition pp = new ParsePosition(0);
pp.setIndex(0);
SimpleDateFormat sd = new SimpleDateFormat(format,Locale.ENGLISH);
Date d = sd.parse(date,pp);
System.out.println("Error Index "+pp.getErrorIndex());
Result Using jdk 6:
Error Index 21
Result Using jdk 7
Error Index 0
Why there is difference in it?
Please help