1
嗨谁能告诉我怎样才能改变一个给定的时间戳格式为其他时间戳格式 像将时间戳格式的值更改为其他时间戳格式?
DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Calendar d1 = Calendar.getInstance();
d1.setTime(formatter.parse("2012-03-08 17:32:56"));
到
"dd-MMM-yyyy HH:mm:ss"
格式
步骤1:解析,步骤2:格式 – 2012-05-04 05:28:32