I'm getting the above Date format from our webservice. I have an idea on how to format the date, im just having issues with the fact it comes down as a string.
I have tried this but I need to return it as a String, which in a way isn't a problem.
This is what I have tried but it throws an Exception:
java.text.ParseException: Unparseable date: "2016-02-26T00:00:00+02:00" (at offset 4)
Code:
public static String formatDate(String unFormattedTime) {
String formattedTime;
try {
SimpleDateFormat sdf = new SimpleDateFormat("dd MMM HH:mm");
Date date = sdf.parse(unFormattedTime);
formattedTime = sdf.format(date);
return formattedTime;
} catch (ParseException e) {
e.printStackTrace();
}
return "";
}
How could I format it in a format like dd MMM HH:mm?