求助哪位Java大神能帮我这这种时间字符串“31-Oct-2014 02:08:57 PM”(时间还有可能是AM),翻译成这种格式"yyyy-MM-dd HH:mm:ss"的时间字符串。 跪谢了……
------解决思路----------------------
JAVA解决方案如下
public static void main(String[] args) throws ParseException {
String dateStr = "Jun 26,2014 4:15:04 PM";
DateFormat formatFrom = new SimpleDateFormat("MMM dd,yyyy KK:mm:ss aa", Locale.ENGLISH);
Date date = formatFrom.parse(dateStr);
DateFormat formatTo = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
System.out.println(formatTo.format(date));
}
------解决思路----------------------


不谢
