Here you can find the source of addDays(Date date, int days)
Parameter | Description |
---|---|
date | a parameter |
days | a parameter |
public static Date addDays(Date date, int days)
//package com.java2s; import java.util.Calendar; import java.util.Date; public class Main { /**/* w w w. ja va 2 s . c om*/ * Add days to an existent date * @param date * @param days * @return */ public static Date addDays(Date date, int days) { Calendar cal = Calendar.getInstance(); cal.setTime(date); cal.add(Calendar.DATE, days); //minus number would decrement the days return cal.getTime(); } }