Calendar calendar=Calendar.getInstance();
SimpleDateFormat smp=new SimpleDateFormat("yyyyMMdd");
Date d=calendar.getTime();
System.out.println("当天的日期 "+smp.format(d));
SimpleDateFormat smp=new SimpleDateFormat("yyyyMMdd");
Date d=calendar.getTime();
System.out.println("当天的日期 "+smp.format(d));
而且不应该继续使用Date的.getXXX方法
应该使用Calendar cal = Calendar.getInstance();
int year = cal.get(Calendar.YEAR);
int month = cal.get(Calendar.MONTH);
int day = cal.get(Calendar.DATE);
int day=re.getDate();
另外,我怎么给你们加分?
getDate()是返回当前是日期
int day=re.getDate();表示同意