Here you can find the source of add(long date, int field, int amount)
public static long add(long date, int field, int amount)
//package com.java2s; //License from project: Apache License import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; public class Main { public static long add(long date, int field, int amount) { Calendar cal = GregorianCalendar.getInstance(); cal.setTime(new Date(date)); cal.add(field, amount);/*from w w w. j a v a2 s. c om*/ return cal.getTime().getTime(); } }