Here you can find the source of getTime(final Date date, final int day)
public static Date getTime(final Date date, final int day)
//package com.java2s; //License from project: Apache License import java.util.Calendar; import java.util.Date; public class Main { public static Date getTime(final int day) { return getTime(new Date(), day); }/* w ww .j av a 2 s .com*/ public static Date getTime(final Date date, final int day) { final Calendar calendar = Calendar.getInstance(); calendar.setTime(date); calendar.set(Calendar.DATE, calendar.get(Calendar.DATE) + day); return calendar.getTime(); } }