public static void main(String[] args){
String dateStr = "Wed Sep 16 11:26:23 CST 2009";
SimpleDateFormat sdf = new SimpleDateFormat("EEE MMM dd HH:mm:ss zzz yyyy", Locale.US);
//java.util.Date对象
Date date;
try {
date = (Date) sdf.parse(dateStr);
//2009-09-16
String formatStr = new SimpleDateFormat("yyyy-MM-dd").format(date);
System.out.println(formatStr);//07014166
} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
11-18
1万+