Here you can find the source of getDay(Date date, int day)
public static Date getDay(Date date, int day)
//package com.java2s; //License from project: Open Source License import java.util.*; public class Main { public static Date getDay(Date date, int day) { long currDateMills = date.getTime(); long extraMills = day * 3600 * 1000 * 24; Calendar result = Calendar.getInstance(); result.setTimeInMillis(currDateMills + extraMills); return result.getTime(); }/*ww w.java 2 s . co m*/ }