Java Date After getDateAfterAddition(Date date, int days)

Here you can find the source of getDateAfterAddition(Date date, int days)

Description

This method adds days to a date

License

Open Source License

Parameter

Parameter Description
date the date.
days the number of days to add.

Declaration

public static Date getDateAfterAddition(Date date, int days) 

Method Source Code

//package com.java2s;

import java.util.Calendar;
import java.util.Date;

public class Main {
    /**//from w  ww  . j  ava 2 s.co  m
     * This method adds days to a date
     *
     * @param date the date.
     * @param days the number of days to add.
     */
    public static Date getDateAfterAddition(Date date, int days) {
        Calendar cal = Calendar.getInstance();

        cal.setTime(date);
        cal.add(Calendar.DATE, days);

        return cal.getTime();
    }
}

Related

  1. getAfterEndDate(Integer day)
  2. getAfterMin(Date date, int min)
  3. getDateAfter(Date d, int day)
  4. getDateAfter(Date date, int days)
  5. getDateAfter(Date date, int increment)
  6. getDateAfterMonths(Date start, int months)
  7. getDateScopeAfterMonth(int year, int month)
  8. getDateTimeAfter(final Date _from, final int _time_type, final int _count)
  9. getMonthAfter(final Date _from, final int _mons)