2

I want to parse a java Date object to the format like below

enter image description here

I tied the below codes

    DateFormat df = new SimpleDateFormat("yyyy-MM-dd");       
    DateFormat dfz = new SimpleDateFormat("dd MMM yyyy");
    Date date = new Date();
    String d = dfz.format(date);
    System.out.println(d); 

then the out put will be like

enter image description here

I checked this SO question and using that I could get the below format

enter image description here

Is there any built-in functionality in java to parse a date object to the first where the th is a superscript format or do I need to do it manually ? And how to do it manually ? What is the easiest way to do this ?

Community
  • 1
  • 1
prime
  • 14,464
  • 14
  • 99
  • 131

1 Answers1

1

Based on the UI you are using you need to handle super script separately. for HTML simply use tag 17th (17<sup>th</sup>)

  • So if I return '17 Jan 2014' to front end then I have to manually do this. ? Like by tokenizing the date and add the sup tag. – prime Feb 10 '15 at 10:03