------ Solution ---------------------------------------- ----
public static void main(String[] args) throws Exception {
String date = "Thu Sep 26 13:12:40 CST 2013";
DateFormat df = new SimpleDateFormat("EEE MMM dd HH:mm:ss 'CST' yyyy",Locale.US);
Date d = df.parse(date);
df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss EEE");
String newDate = df.format(d);
System.out.println(newDate);
}
------ For reference only ---------------------------- -----------
http://www.cnblogs.com/edwardlauxh/archive/2010/03/21/1918615.html
没有评论:
发表评论