Java tutorial
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Calendar; public class Main { public static String getTime(int laterTime) { Calendar calendar = Calendar.getInstance(); if (laterTime != 0) calendar.add(Calendar.HOUR_OF_DAY, 1); return new SimpleDateFormat("hh:mm a").format(calendar.getTime()); } }