1、setTime(Date)方法
(1)Calendar calendar = Calendar.getInstance();
calendar.getTime();-->获取的是当前的时间
(2)calendar.setTime(startDate);
calendar.getTime();-->获取的是指定的时间
所以 java.util.Calendar.setTime(Date) 方法设置日历的时间为给定的日期 Date
后面可以格式化日期
DateFormat partitionDateFormat = new SimpleDateFormat("yyyy-MM-dd").format(calendar.getTime());
2、add()方法
calendar.add(Calendar.DATE,1);--->代表的是1天以后的时间
public abstract void add(int field,int amount)
field -- 日历字段。
amount --要添加到该字段的日期或时间的量。
如果amount是负数代表的是以前的的时间
用到什么再更新