I'm trying to convert this String to Date:
Tue Mar 01 11:46:32 CET 2016
this is the code I have:
DateFormat format = new SimpleDateFormat("EEE MMM dd HH:mm:ss zzz yyyy");
Date mTimeStamp = format.parse(getTimeStamp());
it throws a ParseExeption...
Your format is fine - your issue may be that your default locale is not English and the day and/or month names are not valid in your default language.
This should work as expected:
DateFormat format = new SimpleDateFormat("EEE MMM dd HH:mm:ss zzz yyyy", Locale.ENGLISH);
Date mTimeStamp = format.parse("Tue Mar 01 11:46:32 CET 2016");
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