I'm trying to parse a date string I got out of a website in Java using the SimpleDateFormat class, but something goes wrong and I can't figure out why.
The date strings come in the following syntax:
"13:37 - Tue 28-Jun-2011"
So I tried doing the following:
SimpleDateFormat dateFormat = new SimpleDateFormat("HH:mm - EEE dd-MMM-yyyy");
ParsePosition pos = new ParsePosition(0);
Date d = dateFormat.parse("13:37 - Tue 28-Jun-2011", pos);
As I said before, this doesn't work; when I print
System.out.println(pos.getErrorIndex());
it prints "8", which I assume means that the error is somewhere around the EEE part. I've tried different permutations but nothing worked. What am I doing wrong?
Thanks
bompf