日期:2014-05-20  浏览次数:20871 次

格式化日期报错....
Date   date   =   new   Date();
SimpleDateFormat   sdf   =new   SimpleDateFormat( "yyyy-MM-dd ");
try   {
System.out.println(sdf.parse(date.toString()));
}   catch   (ParseException   e)   {
e.printStackTrace();
}

java.text.ParseException:   Unparseable   date:   "Thu   May   31   20:24:06   CST   2007 "

就剩这几分了,全给了.

------解决方案--------------------
Date date = new Date();
SimpleDateFormat sdf =new SimpleDateFormat( "yyyy-MM-dd ");
try {
System.out.println(sdf.format(date));
} catch (Exception e) {
e.printStackTrace();
}杩欎釜璇ュ彲浠ヨВ鍐充綘鐨勯棶棰