Here you can find the source of monthIndexAsString(Integer index, Integer offset)
public static String monthIndexAsString(Integer index, Integer offset)
//package com.java2s; //License from project: Open Source License import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; public class Main { public static String monthIndexAsString(Integer index, Integer offset) { if (index == null) { return ""; }//from w w w . j av a2 s.c o m index = index - offset + 1; String result = ""; SimpleDateFormat numberFormat = new SimpleDateFormat("MM"); SimpleDateFormat stringFormat = new SimpleDateFormat("MMMM", Locale.US); try { Date date = numberFormat.parse(index.toString()); result = stringFormat.format(date); } catch (Exception e) { } return result; } }