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