Mahi
Mahi

Reputation: 1784

Android Day and date in String format

How to display day and month in string format. I want to display day and date and month. Look like that

  Thursday
    11
   April

but when I used Calender class it returns date and day in different format just like yyyy-mm-dd

Upvotes: 0

Views: 235

Answers (1)

Jackson Chengalai
Jackson Chengalai

Reputation: 3937

    SimpleDateFormat sString s= "2013-1-18";
    SimpleDateFormat sdf = new SimpleDateFormat("EEEE,MMMM, dd ");
    System.out.println(sdf.format(new SimpleDateFormat("yyyy-M-dd").parse(s)));

Upvotes: 1

Related Questions