I got the common problem that I want to parse a String to a Date.
The String looks like this 15.06.11 13:38:33 UTC. But the result is 15.38.0011 13:38:33 UTC when formatted with the same formatter used to parse the String to Date. TimeInMillis returns a negative value -61818978087000.
SimpleDateFormat formatter = new SimpleDateFormat("dd.mm.yyyy HH:mm:ss z");
formatter.setLenient(false);
Date time = formatter.parse("15.06.11 13:38:33 UTC");
Calendar timestamp = Calendar.getInstance();
timestamp.setTime(time);
I m thankful for every help that I can get. Maybe I am making some stupid mistake but I dont see it. Please open my eyes.
Months are
MM, notmm(which is minutes)and
yyyytoyy(your year is 2-digit as it seems) (thanks to Peter for noticing that)