Here you can find the source of add(Timestamp target, int addNum, int addKind)
public static Timestamp add(Timestamp target, int addNum, int addKind)
//package com.java2s; //License from project: Apache License import java.sql.Timestamp; import java.util.Date; import java.util.GregorianCalendar; public class Main { public static Timestamp add(Timestamp target, int addNum, int addKind) { GregorianCalendar cal = new GregorianCalendar(); cal.setTime(target);//ww w.jav a 2 s . com cal.add(addKind, addNum); return new Timestamp(new Date(cal.getTimeInMillis()).getTime()); } }