Here you can find the source of add(int datePart, int detal, Date date)
private static Date add(int datePart, int detal, Date date)
//package com.java2s; import java.util.Calendar; import java.util.Date; public class Main { private static Date add(int datePart, int detal, Date date) { Calendar c = Calendar.getInstance(); if (date != null) c.setTime(date);//from w w w. j a v a2 s . c o m c.add(datePart, detal); return c.getTime(); } }