Here you can find the source of addHour(java.util.Date d, int h)
public static Calendar addHour(java.util.Date d, int h)
//package com.java2s; //License from project: Apache License import java.util.Calendar; public class Main { public static Calendar addHour(java.util.Date d, int h) { if (d == null) return null; Calendar cal = Calendar.getInstance(); cal.setTime(d);/* w w w. j a v a2 s .c o m*/ cal.add(Calendar.HOUR, h); return cal; } public static Calendar add(java.util.Date d, int day) { if (d == null) return null; Calendar cal = Calendar.getInstance(); cal.setTime(d); cal.add(Calendar.DATE, day); return cal; } }