I have a list with many Date Strings such as "Fri, 08 Apr 2011 22:28:00 -0400" and need to parse them to a proper format (Friday, 08. April 2011). My problem is that the device needs a very very long time parsing > 10 date objects and occasionally runs out of memory. Is there a more efficient way parsing dates as:
SimpleDateFormat sdf = new SimpleDateFormat("E, dd MMM yyyy HH:mm:ss Z", Locale.ENGLISH);
// later in code
try {
Date date = sdf.parse(myDateString);
return DateFormat.format("dd. MMMM yyyy", date).toString();
} catch (java.text.ParseException e) {
}
How can I parse many date Strings very fast?