Fri Jan 23 00:00:00 CST 2015
public static void main(String[] args) throws ParseException {
SimpleDateFormat s = new SimpleDateFormat("yyyy-MM-dd");
Date d = s.parse("2015-01-23");
System.out.println(d);//Fri Jan 23 00:00:00 CST 2015
}
2.DateUtil.format(new date(),"yyyy-MM-dd HH:mm:ss")返回string
String t = s.format(new Date());
System.out.println(t);//2017-06-06 11:24:52