Java Utililty Methods Day Add

List of utility methods to do Day Add

Description

The list of methods to do Day Add are organized into topic(s).

Method

DateaddDay(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();
DateaddDay(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();
DateaddDay(Date date, int n)
add Day
Calendar cal = Calendar.getInstance();
cal.setTime(date);
cal.add(Calendar.DATE, n);
return cal.getTime();
DateaddDay(Date date, int num)
add Day
Calendar startDT = Calendar.getInstance();
startDT.setTime(date);
startDT.add(Calendar.DAY_OF_MONTH, num);
return startDT.getTime();
DateaddDay(Date date, int num)
add Day
Calendar c = Calendar.getInstance();
c.setTime(date);
c.add(Calendar.DAY_OF_YEAR, num);
return c.getTime();
StringaddDay(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());
DateaddDay(Date oriDate, int amount)
add Day
Calendar cal = Calendar.getInstance();
cal.setTime(oriDate);
cal.add(Calendar.DAY_OF_MONTH, amount);
return cal.getTime();
DateaddDay(int days)
add Day
return addDay(new Date(), days);
DateaddDay(int k)
add Day
car.add(Calendar.DAY_OF_MONTH, k);
return car.getTime();
java.util.DateaddDay(java.util.Date date)
add Day
java.util.Calendar cal = Calendar.getInstance();
cal.setTime(date);
cal.add(Calendar.DATE, 1);
return cal.getTime();