Here you can find the source of plusDays(Date date, int days)
public static Date plusDays(Date date, int days)
//package com.java2s; import java.text.SimpleDateFormat; import java.util.*; public class Main { private final static SimpleDateFormat sdfTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); public static Date plusDays(Date date, int days) { if (date == null) date = getToday();/*from w w w. j a v a 2 s . c o m*/ return changeDays(date, days); } public static Date getToday() { return new Date(); } private static Date changeDays(Date date, int days) { Calendar cal = Calendar.getInstance(); cal.setTime(date); cal.add(Calendar.DAY_OF_YEAR, days); return cal.getTime(); } public static String getTime() { return sdfTime.format(new Date()); } }