Here you can find the source of addDay(Date date, int num)
public static Date addDay(Date date, int num)
//package com.java2s; //License from project: Apache License import java.util.Calendar; import java.util.Date; public class Main { public static Date addDay(Date date, int num) { Calendar startDT = Calendar.getInstance(); startDT.setTime(date);/*from w w w . ja va 2s. c om*/ startDT.add(Calendar.DAY_OF_MONTH, num); return startDT.getTime(); } public static Integer addDay(Integer time, int day) { Calendar calendar = Calendar.getInstance(); calendar.setTimeInMillis(Long.valueOf(time + "000")); calendar.add(Calendar.HOUR_OF_DAY, day * 24); return Integer.valueOf(String.valueOf(calendar.getTimeInMillis()).substring(0, 10)); } }