Friday, May 16, 2008

Java Date Increment


public static Date incrementHours(Date date, int hours)
{
GregorianCalendar calendar = new GregorianCalendar();
calendar.setTime(date);
calendar.add(Calendar.HOUR_OF_DAY, hours);
return calendar.getTime();
}