|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 得到X分钟后的时间(时间格式) | 
|---|
|  |  |  | * | 
|---|
|  |  |  | * @param date | 
|---|
|  |  |  | * @param minute | 
|---|
|  |  |  | * @return | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | public static Date getXMinuteAfterDate(Date date, int minute) { | 
|---|
|  |  |  | Calendar now = Calendar.getInstance(); | 
|---|
|  |  |  | now.setTime(date); | 
|---|
|  |  |  | now.set(Calendar.MINUTE, now.get(Calendar.MINUTE) + minute); | 
|---|
|  |  |  | return now.getTime(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 得到两个日期之间相差的天数 | 
|---|
|  |  |  | * | 
|---|
|  |  |  | * @param newDate | 
|---|
|  |  |  | 
|---|
|  |  |  | return DateToStr(date, "yyyyMMdd"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public static String afterDateHourToStr(Integer hour){ | 
|---|
|  |  |  | Date date = new Date(); | 
|---|
|  |  |  | Long l = date.getTime()+1000*60*60*hour; | 
|---|
|  |  |  | date.setTime(l); | 
|---|
|  |  |  | return DateToStr(date, "yyyyMMdd"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public static String beforeDateToStr(Integer days){ | 
|---|
|  |  |  | Date date = new Date(); | 
|---|
|  |  |  | Long l = date.getTime()-1000*60*60*24*days; | 
|---|