Here you can find the source of addDays(Date date, int days)
public static Date addDays(Date date, int days)
//package com.java2s; //License from project: Apache License import java.util.Calendar; import java.util.Date; public class Main { public static Date addDays(Date date, int days) { if (date == null) return date; Calendar calendar = Calendar.getInstance(); calendar.setTime(date);/*from ww w .ja v a2 s . co m*/ calendar.set(Calendar.DAY_OF_MONTH, calendar.get(Calendar.DAY_OF_MONTH) + days); return calendar.getTime(); } }