I am trying to parse a String into a Calendar but right now I'm having problems at TimeZone: My code:
public static Calendar convertStringToFullDates(String dateString) {
Calendar cal = Calendar.getInstance();
SimpleDateFormat sdf = new SimpleDateFormat(PATTENT_FULL_DATE_FORMAT, Locale.US);
try {
cal.setTime(sdf.parse(dateString));
} catch (ParseException e) {
DebugLog.e(e.getLocalizedMessage());
}
return cal;
}
and String :
String str = "Fri May 11 00:00:00 ICT 2018";
and pattern:
private static final String PATTENT_FULL_DATE_FORMAT = "EEE MMM dd HH:mm:ss z yyyy";
I tried but it throws an exception like this:
Unparseable date: "Fri May 11 00:00:00 ICT 2018"
How to solve this problem?