I'm trying to get Date from String,
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("EEE, d MMM yyyy HH:mm:ss Z");
Date date = simpleDateFormat.parse(dateString);
My date string is:
Wed, 02 September 2015 08:27:00 MSK
I'm getting this error:
java.text.ParseException: Unparseable date: "Wed, 02 September 2015 08:27:00 MSK" (at offset 32)
What's wrong? Thx for help.
I see that you have MSK time. Is your locale English or Russian ? Because if your locale is Russian, September is not a valid month. So, you have 2 options :
Fix for changing the locale to English :
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("EEE, d MMM yyyy HH:mm:ss Z", Locale.ENGLISH);
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