Here you can find the source of getDateAfterAddition(Date date, int days)
Parameter | Description |
---|---|
date | the date. |
days | the number of days to add. |
public static Date getDateAfterAddition(Date date, int days)
//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(); } }