将字符串转化为data DateFormat f = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//设置格式 Date d = f.parse("2007-09-11 12:15:47");