Here you can find the source of add(Timestamp ts, int field, int amount)
public static Timestamp add(Timestamp ts, int field, int amount)
//package com.java2s; //License from project: Apache License import java.util.*; import java.sql.Timestamp; public class Main { public static Timestamp add(Timestamp ts, int field, int amount) { Calendar cal = Calendar.getInstance(); cal.setTime(ts);//from ww w .jav a 2s . com cal.add(field, amount); Timestamp ts2 = new Timestamp(cal.getTime().getTime()); return ts2; } }