Here you can find the source of addDays(Date startDate, int numDays)
public static Date addDays(Date startDate, int numDays)
//package com.java2s; //License from project: Open Source License import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; public class Main { public static Date addDays(Date startDate, int numDays) { Calendar inst = GregorianCalendar.getInstance(); inst.setTime(startDate);//ww w . ja v a 2 s.c om inst.add(Calendar.DAY_OF_YEAR, numDays); return inst.getTime(); } }