フォーマットの文字列として日付があり、 string2013-02-12T20:52:20Z
を取得したい20:52 12 Feb 2013
。
これを行う方法?
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);
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();
}