Java tutorial
//package com.java2s; public class Main { public static String getHour(int Hour) { StringBuilder hourStr = new StringBuilder(); if (Hour < 10) { hourStr.append("0" + Hour); } else { hourStr.append(Hour); } return hourStr.toString(); } }