0

フォーマットの文字列として日付があり、 string2013-02-12T20:52:20Zを取得したい20:52 12 Feb 2013

これを行う方法?

4

2 に答える 2

3
DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
Date date = dateFormat.parse(yourStringDate);
String newDateString = new SimpleDateFormat("HH:mm dd MMM yyyy").format(date);
于 2013-02-14T15:13:47.047 に答える
0

Try this

String datemillis = "2013-02-12T20:52:20Z";
            SimpleDateFormat  format = new SimpleDateFormat("yyyy-MM-dd");

            Date convertedDate = new Date();
            try {
                convertedDate = format.parse(datemillis);
            } catch (ParseException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
于 2015-01-22T08:17:31.930 に答える