SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
long time = System.currentTimeMillis();
Date date = new Date(time);
Calendar cal = Calendar.getInstance();
cal.add(Calendar.DAY_OF_MONTH, +400);
date = cal.getTime();
System.out.println( sdf.format(date));
欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/) | 黑马程序员IT技术论坛 X3.2 |