List of utility methods to do Day Add
Date | addDay(Date date, int dayAmount) add Day if (date == null) { return null; Calendar calendar = Calendar.getInstance(); calendar.setTime(date); calendar.add(Calendar.DATE, dayAmount); return calendar.getTime(); |
Date | addDay(Date date, int days)The calculation of the date of increase, reducing the number of days of the date.if (date == null) { return null; Calendar c = getCalendar(date); c.add(Calendar.DATE, days); return c.getTime(); |
Date | addDay(Date date, int n) add Day Calendar cal = Calendar.getInstance();
cal.setTime(date);
cal.add(Calendar.DATE, n);
return cal.getTime();
|
Date | addDay(Date date, int num) add Day Calendar startDT = Calendar.getInstance();
startDT.setTime(date);
startDT.add(Calendar.DAY_OF_MONTH, num);
return startDT.getTime();
|
Date | addDay(Date date, int num) add Day Calendar c = Calendar.getInstance();
c.setTime(date);
c.add(Calendar.DAY_OF_YEAR, num);
return c.getTime();
|
String | addDay(Date date, String pattern, int num) add Day SimpleDateFormat simpleDateFormat = new SimpleDateFormat(pattern); Calendar calender = Calendar.getInstance(); calender.setTime(date); calender.add(Calendar.DATE, num); return simpleDateFormat.format(calender.getTime()); |
Date | addDay(Date oriDate, int amount) add Day Calendar cal = Calendar.getInstance();
cal.setTime(oriDate);
cal.add(Calendar.DAY_OF_MONTH, amount);
return cal.getTime();
|
Date | addDay(int days) add Day return addDay(new Date(), days); |
Date | addDay(int k) add Day car.add(Calendar.DAY_OF_MONTH, k);
return car.getTime();
|
java.util.Date | addDay(java.util.Date date) add Day java.util.Calendar cal = Calendar.getInstance();
cal.setTime(date);
cal.add(Calendar.DATE, 1);
return cal.getTime();
|