Here you can find the source of addDay(Date date, int dayAmount)
public static Date addDay(Date date, int dayAmount)
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; public class Main { public static Date addDay(Date date, int dayAmount) { if (date == null) { return null; }//from w ww. jav a 2s.c om Calendar calendar = Calendar.getInstance(); calendar.setTime(date); calendar.add(Calendar.DATE, dayAmount); return calendar.getTime(); } public static String getTime(Date date) { if (date == null) { return null; } SimpleDateFormat format = new SimpleDateFormat("HH:mm:ss"); return format.format(date); } }