java - How do I convert dateformat from Date to April 19th or April 22nd -


is there way convert date object string. example,

date date = ......... ;

date.tostring shows wed april 17 00:00:00.0 cest 2016"

and want display april 17th, removing informations.

use simpledateformat:

string strdate = new simpledatformat("mmm dd").format(date); 

as st/rd/th need add manually, e.g. doing if , appending strdate.


Comments

Popular posts from this blog

jOOQ update returning clause with Oracle -

java - Warning equals/hashCode on @Data annotation lombok with inheritance -

java - BasicPathUsageException: Cannot join to attribute of basic type -