public static Date setHours(Date d, int hours) {
       Calendar cal = Calendar.getInstance();
       cal.setTime(d);
       cal.set(Calendar.HOUR_OF_DAY, hours);
       return cal.getTime();
   }
public static Date setHours ( Date d , int hours ) { Calendar cal = Calendar . getInstance ( ) ; cal . setTime ( d ) ; cal . set ( Calendar . HOUR_OF_DAY , hours ) ; return cal . getTime ( ) ; }
Set hours to a date

@param d date
@param hours hours
@return new date