Here you can find the source of convertMonthFromNumber(int month)
public static String convertMonthFromNumber(int month)
//package com.java2s; //License from project: Apache License public class Main { public static String convertMonthFromNumber(int month) { if (month < 1) { return "01"; } else if (month >= 1 && month <= 9) { return "0" + month; } else if (month >= 10 && month <= 12) { return "" + month; } else {//from ww w. jav a2 s. com return "12"; } } }