String time= Dateformat.format(Date date);可以将时间转化成字符串DateFormate formate = new SimpleDateFormat(“yyyy—mm—dd”);构造方法格式化formate.parse(String source):检验给定的字符串是否符合上面格式y:YearY:Week yearM&m:Month in yearD:Day in yeard:Day in month