Java tutorial
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static String getNextHour(String format, int h) { SimpleDateFormat sdf = new SimpleDateFormat(format); Date date = new Date(); date.setTime(date.getTime() + h * 60 * 60 * 1000); return sdf.format(date); } }