Q:

Java/ Android : Convert a Date like "2014-11-26T15:58:54.259+01:00" to current Locale

I got a date like "2014-11-26T15:58:54.259+01:00" from my Webservice
and i want to convert it to the locale configured on my device.
Here is what i have done so far :
String string = currentDatasetBundle.dataset.created_at;
SimpleDateFormat inFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ",Locale.GERMANY);
SimpleDateFormat outFormat = (SimpleDateFormat) android.text.format.DateFormat.getDateFormat(getContext());
Date date;

String output = null;
try {
    date = inFormat.parse(string);
    output = outFormat.format(date);
} catch (ParseException e) {
    e.printStackTrace();
}
dateLabel.setText(output);

Everything works fine, but the Time wont show up inside my output String.
It looks like 11/26/2014 but I want to also show the Time like 11/26/2014 15:58:54 ?
What I am doing wrong ?

A:

You're using android.text.format.DateFormat.getDateFormat() which only formats the date. Append android.text.format.DateFormat.getTimeFormat() to the output.

Full code:
String string = currentDatasetBundle.dataset.created_at;
SimpleDateFormat inFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ",Locale.GERMANY);
Date date;

String output = null;
try {
    date = inFormat.parse(string);
    output = android.text.format.DateFormat.getDateFormat(getContext()).format(date)
        + " " + android.text.format.DateFormat.getTimeFormat(getContext());
} catch (ParseException e) {
    e.printStackTrace();
}
dateLabel.setText(output);

