时间格式转换
把这样的字符串
Fri Mar 22 14:57:37 CST 2013
转换成字符串
yyyy-MM-dd HH:mm:ss
[解决办法]
String s = "Fri Mar 22 14:57:37 CST 2013";
SimpleDateFormat format = new SimpleDateFormat("EEE MMM dd HH:mm:ss 'CST' yyyy", Locale.US);
SimpleDateFormat format2 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
System.out.println(format2.format(format.parse(s)));
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");