public static String formatDate(Date date) {
DateFormat formatter = DateFormat.getDateTimeInstance(
DateFormat.MEDIUM, DateFormat.MEDIUM, Locale.US);
try {
SimpleDateFormat simpleFormatter = (SimpleDateFormat) formatter;
simpleFormatter.applyPattern("EEE, d MMM yyyy kk:mm:ss z");
String result = simpleFormatter.format(date);
return result;
} catch (Exception e) {
// Simple formatter not supported.
}