Here you can find the source of DateAddDays(Date _date, int days)
public static String DateAddDays(Date _date, int days)
//package com.java2s; //License from project: Apache License import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; public class Main { private static final SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); public static String DateAddDays(Date _date, int days) { Calendar cl = Calendar.getInstance(); cl.setTime(_date);//w w w. j ava 2 s .c o m cl.add(Calendar.DAY_OF_YEAR, days); _date = cl.getTime(); return simpleDateFormat.format(_date); } }