Here you can find the source of addDate(java.util.Date date, int day)
public static java.util.Date addDate(java.util.Date date, int day)
//package com.java2s; import java.sql.Timestamp; import java.util.Calendar; public class Main { public static java.util.Date addDate(java.util.Date date, int day) { java.util.Calendar c = java.util.Calendar.getInstance(); c.setTimeInMillis(getMillis(date) + ((long) day) * 24 * 3600 * 1000); return c.getTime(); }/* ww w. j av a2 s . c om*/ public static java.util.Date addDate(java.util.Date date, long mm) { java.util.Calendar c = java.util.Calendar.getInstance(); c.setTimeInMillis(getMillis(date) + mm); return c.getTime(); } public static long getMillis(java.util.Date date) { java.util.Calendar c = java.util.Calendar.getInstance(); c.setTime(date); return c.getTimeInMillis(); } public static String getTime() { Timestamp time = new Timestamp(Calendar.getInstance().getTime().getTime()); return time.toString(); } }