Here you can find the source of getNextDay(Date startTime, int n)
public static Date getNextDay(Date startTime, int n)
//package com.java2s; //License from project: Open Source License import java.util.*; public class Main { public static Date getNextDay(Date startTime, int n) { Calendar calendar = new GregorianCalendar(); calendar.setTime(startTime);//from ww w . j ava 2s. c om calendar.add(Calendar.DATE, n); return calendar.getTime(); } public static Date add(Date when, int field, int amount) { Calendar calendar = Calendar.getInstance(); calendar.setTime(when); calendar.add(field, amount); return calendar.getTime(); } }