Java tutorial
//package com.java2s; import java.util.Calendar; public class Main { public static String toTimeString(Calendar date) { String hour = "" + date.get(Calendar.HOUR_OF_DAY); String minute = "" + date.get(Calendar.MINUTE); if (minute.length() == 1) minute = "0" + minute; return hour + ":" + minute; } }