Java tutorial
//package com.java2s; public class Main { private static String timeStrFormat(String timeStr) { switch (timeStr.length()) { case 1: timeStr = "0" + timeStr; break; } return timeStr; } }