Here you can find the source of addHour(Date date, boolean up)
public static Date addHour(Date date, boolean up)
//package com.java2s; //License from project: Open Source License import java.util.Calendar; import java.util.Date; public class Main { public static Date addHour(Date date, boolean up) { Calendar cal = Calendar.getInstance(); cal.setTime(date);//from ww w .ja va 2s .c om if (up) { cal.add(Calendar.HOUR_OF_DAY, 1); } else { cal.add(Calendar.HOUR_OF_DAY, -1); } return cal.getTime(); } }