Here you can find the source of minusHours(Timestamp ts, int hours)
public static Timestamp minusHours(Timestamp ts, int hours)
//package com.java2s; //License from project: Open Source License import java.sql.Timestamp; import org.joda.time.DateTime; import org.joda.time.DateTimeZone; public class Main { public static Timestamp minusHours(Timestamp ts, int hours) { DateTime dateTime = new DateTime(ts.getTime(), DateTimeZone.UTC); DateTime retval = dateTime.minusHours(hours); Timestamp retts = new Timestamp(retval.getMillis()); retts.setNanos(ts.getNanos());/*from w w w. j a v a 2 s. c om*/ return retts; } }