Is there a way to convert the date object into String. For example,
Date date = ......... ;
date.toString shows something like Wed April 17 00:00:00.0 CEST 2016"
and I want to display as only April 17th, removing extra informations.
Is there a way to convert the date object into String. For example,
Date date = ......... ;
date.toString shows something like Wed April 17 00:00:00.0 CEST 2016"
and I want to display as only April 17th, removing extra informations.
Use SimpleDateFormat
:
String strDate = new SimpleDatFormat("MMM dd").format(date);
as for st/rd/th you will need to add it manually, e.g. by doing if and appending those to the strDate
.