java 获取几天前跟几天后的时间
java 获取几天前和几天后的时间** ????*?得到几天前的时间 ????*?@param?d ????*?@param?day ????*?@retur
java 获取几天前和几天后的时间
** ????*?得到几天前的时间 ????*?@param?d ????*?@param?day ????*?@return ????*/????public?static?Date?getDateBefore(Date?d,int?day){ ?????Calendar?now?=Calendar.getInstance(); ?????now.setTime(d); ?????now.set(Calendar.DATE,now.get(Calendar.DATE)-day); ?????return?now.getTime(); ????} ???? ????/** ????*?得到几天后的时间 ????*?@param?d ????*?@param?day ????*?@return ????*/????public?static?Date?getDateAfter(Date?d,int?day){ ?????Calendar?now?=Calendar.getInstance(); ?????now.setTime(d); ?????now.set(Calendar.DATE,now.get(Calendar.DATE)+day); ?????return?now.getTime(); ????}??