Here you can find the source of formatHour(String string)
public static String formatHour(String string)
//package com.java2s; public class Main { public static String formatHour(String string) { return (string.length() == 1) ? "0" + string : string; }// w ww. j a va 2 s . c o m public static String formatHour(int val) { return formatHour(String.valueOf(val)); } }