Here you can find the source of nextHour(Date date)
public static Date nextHour(Date date)
//package com.java2s; //License from project: Open Source License import java.text.SimpleDateFormat; import java.util.Date; public class Main { static SimpleDateFormat minuteFormat = new SimpleDateFormat("mm"); static SimpleDateFormat secondFormat = new SimpleDateFormat("ss"); public static Date nextHour(Date date) { long now = date.getTime(); int min = Integer.valueOf(minuteFormat.format(date)); int sec = Integer.valueOf(secondFormat.format(date)); long begin = now - min * 60 * 1000 - sec * 1000; long end = begin + 60 * 60 * 1000; return new Date(end); }/* w ww . j a va 2 s . c o m*/ }