Java tutorial
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; public class Main { public static String getNextHourDateTime() { Calendar c = Calendar.getInstance(); c.add(Calendar.HOUR, 1); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:MM:ss"); String nextTime = sdf.format(new Date(c.getTimeInMillis())); return nextTime; } }