Here you can find the source of dateAdd(Date date, int type, int num)
public static Date dateAdd(Date date, int type, int num)
//package com.java2s; //License from project: Apache License import java.util.Calendar; import java.util.Date; public class Main { public static Date dateAdd(Date date, int type, int num) { Calendar c = Calendar.getInstance(); c.setTime(date);/*from w w w .ja va 2 s. c o m*/ c.add(type, num); return c.getTime(); } public static Date dateAdd(Date date, int type1, int num1, int type2, int num2) { Calendar c = Calendar.getInstance(); c.setTime(date); c.add(type1, num1); c.add(type2, num2); return c.getTime(); } }