Here you can find the source of addHours(Timestamp date, int numOfHours)
public static Timestamp addHours(Timestamp date, int numOfHours)
//package com.java2s; import java.sql.Timestamp; public class Main { public static Timestamp addHours(Timestamp date, int numOfHours) { //changed Long milliSecInAnHour = new Long(60 * 60 * 1000); Timestamp newTS = new Timestamp(date.getTime()); long milliSecToAdd = milliSecInAnHour * numOfHours; long newTimeMilliSec = newTS.getTime(); newTS.setTime(newTimeMilliSec + milliSecToAdd); return newTS; }/*from w ww . j av a 2 s . co m*/ }