Here you can find the source of getHourDetails(int timeInfo)
private static String getHourDetails(int timeInfo)
//package com.java2s; //License from project: Open Source License import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; public class Main { private static String getHourDetails(int timeInfo) { Calendar cal = Calendar.getInstance(); cal.setTime(new Date()); cal.set(Calendar.HOUR_OF_DAY, timeInfo); SimpleDateFormat formatter = new SimpleDateFormat("dd/MMM/yyyy HH:MM"); return formatter.format(cal.getTime()); }//ww w . j a v a 2s . c om }