Here you can find the source of time2String(int hour, int minute)
public static String time2String(int hour, int minute)
//package com.java2s; public class Main { /**//from ww w. ja v a 2s .c om * Convert integer hour and minute to string format * * @return Converted hour in "hh:mm" format */ public static String time2String(int hour, int minute) { return String.format("%02d", hour) + ":" + String.format("%02d", minute); } }