0

For a Android app I need to pase a string to a date object. This is the code I use:

SimpleDateFormat df = new SimpleDateFormat("EEE MMM d HH:mm:ss z yyyy", Locale.ENGLISH);
Date d = df.parse("Thu May 15 00:00:00 CEST 2008");

But I get the following exception: java.text.ParseException: Unparseable date: "Thu May 15 00:00:00 CEST 2008"

Who can help me?

Japser
  • 1
  • 1
    possible duplicate of [Java String to Date, ParseException](http://stackoverflow.com/questions/7045931/java-string-to-date-parseexception) – duffymo Aug 12 '11 at 22:05

1 Answers1

0

What happens when you SimpleDateFormat("EEE MMM d HH:mm:ss z yyyy"); without locale info?

This other question/answer may help you as well: SimpleDateFormat and locale based format string

Community
  • 1
  • 1
atraudes
  • 2,368
  • 2
  • 21
  • 31
  • Without the locale info, I get the same exception. Also with the example I get a exception: DateFormat df = DateFormat.getDateInstance(DateFormat.FULL (also tryed with short, medium etc..), Locale.UK); Date d = df.parse("Thu May 15 00:00:00 CEST 2008"); – Japser Aug 12 '11 at 22:11