How to get Date format like this in android?

前端 未结 2 1405
情深已故
情深已故 2021-01-29 00:22

How to get Date format like this?

Saturday,Dec 11,2011

Edited:

My code portion is like the following:

   String outDate         


        
相关标签:
2条回答
  • 2021-01-29 00:32

    You can use SimpleDateFormat.

    Try:

    SimpleDateFormat formatter = new SimpleDateFormat("EEEE,MMM dd,yyyy");
    String text = formatter.format(...);
    

    That will use the default locale - adjust accordingly for a different one.

    0 讨论(0)
  • 2021-01-29 00:42

    Try to use this function

     Date today=new Date();
            public String getCurrentTime()
            {
    
             SimpleDateFormat sdf = new SimpleDateFormat("EEEE,MM,dd,YYYY");
             String ClsCurrentDay = sdf.format(today);
             return ClsCurrentDay;
            }
    
    0 讨论(0)
提交回复
热议问题