You can use SimpleDateFormat to parse String to Date.
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss"); try { Date d = sdf.parse("20130526160000"); } catch (ParseException ex) { Log.v("Exception", ex.getLocalizedMessage()); }
Now you can convert your Date object back to String in the required format, as shown below.
sdf.applyPattern("dd MMM yyyy hh:mm"); System.out.println(sdf.format(d));
source share