String that I want to parse:
Sun Nov 10 10:00:00 CET 2013
My code:
substrings = "Sun Nov 10 10:00:00 CET 2013"
SimpleDateFormat parserSDF = new SimpleDateFormat("EEE MMM d HH:mm:ss ZZZ yyyy");
Date date = parserSDF.parse(substrings);
Compiler error output:
java.text.ParseException: Unparseable date: "Sun Nov 10 10:00:00 CET 2013" at java.text.DateFormat.parse(Unknown Source) ...
Probably you are missing the correct Locale. Try this, in your example:
SimpleDateFormat parserSDF = new SimpleDateFormat("EEE MMM d HH:mm:ss ZZZ yyyy", Locale.US);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With