Java Calendar Add addDate(Calendar baseDate, int addDate)

Here you can find the source of addDate(Calendar baseDate, int addDate)

Description

add Date

License

Open Source License

Declaration

public static Calendar addDate(Calendar baseDate, int addDate) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.Calendar;

public class Main {

    public static Calendar addDate(Calendar baseDate, int addDate) {
        return add(baseDate, 0, 0, addDate, 0, 0, 0, 0);
    }/*www.j  a va2  s.  com*/

    public static Calendar add(Calendar cal, int addYera, int addMonth, int addDate, int addHour, int addMinute,
            int addSecond, int addMillisecond) {
        if (cal == null) {
            cal = Calendar.getInstance();
        }
        cal.add(Calendar.YEAR, addYera);
        cal.add(Calendar.MONTH, addMonth);
        cal.add(Calendar.DATE, addDate);
        cal.add(Calendar.HOUR_OF_DAY, addHour);
        cal.add(Calendar.MINUTE, addMinute);
        cal.add(Calendar.SECOND, addSecond);
        cal.add(Calendar.MILLISECOND, addMillisecond);
        return cal;
    }
}

Related

  1. add(final Date date, final int calendarField, final int amount)
  2. add2Calendar(Calendar cal, int years, int months, int days, int hours, int minutes, int seconds, int millis)
  3. addCalendarDate(Calendar cal, int date)
  4. addCalendarMonthsToUnixtime(long time, int interval)
  5. addCalendarQuarterOfYear(Calendar cal, int quartersOfYear)
  6. addDate(Calendar baseDate, int diffDate, TimeZone timezone)
  7. addDate(Date date, int calendarField, int amount)
  8. addDate(Date date, int calendarField, int numberToAdd)
  9. addDayOffset(final Calendar date, long offset)