Java date format convert on Android

后端 未结 8 1538
感情败类
感情败类 2020-12-22 10:14

I have date String as below:

Fri, 19 Jul 2013 01:30:22 GMT
Thu, 12 Sep 2013 19:19:18 GMT

And I want to convert to below format:

相关标签:
8条回答
  • 2020-12-22 11:00

    You can make like this.

    String newDate = date.getYear()+"/"+date.getMonth()+"/"+date.getDay() and ect.
    

    or you can write your own convert method

    String myConvert(Date date)
    {
    return date.getYear()+"/"+date.getMonth()+"/"+date.getDay()+ect.
    }
    
    0 讨论(0)
  • 2020-12-22 11:04
    SimpleDateFormat simpleDateFormat=new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
    Date date = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss Z");
    date.parse("Fri, 19 Jul 2013 01:30:22 GMT");
    String newDate = simpleDateFormat.format(date);
    
    0 讨论(0)
提交回复
热议问题