Here you can find the source of getHourAfter(final Date _from, final int _hours)
public static Date getHourAfter(final Date _from, final int _hours)
//package com.java2s; //License from project: Apache License import java.util.Calendar; import java.util.Date; public class Main { public static Date getHourAfter(final Date _from, final int _hours) { return getDateTimeAfter(_from, Calendar.HOUR_OF_DAY, _hours); }/*from w w w . j ava 2s .com*/ public static Date getDateTimeAfter(final Date _from, final int _time_type, final int _count) { final Calendar c = Calendar.getInstance(); if (_from != null) { c.setTime(_from); } c.add(_time_type, _count); return c.getTime(); } }