Here you can find the source of add(int field, int value, Date fromDate)
private static Date add(int field, int value, Date fromDate)
//package com.java2s; //License from project: Open Source License import java.util.Calendar; import java.util.Date; public class Main { private static Date add(int field, int value, Date fromDate) { fromDate = (fromDate == null) ? new Date() : fromDate; Calendar cal = Calendar.getInstance(); cal.setTime(fromDate);// ww w . j a v a 2 s . c o m cal.add(field, value); return cal.getTime(); } }