Here you can find the source of formatMonth(Date date)
public static String formatMonth(Date date)
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public final static String monthFormat = "yyyyMM"; public static String formatMonth(Date date) { if (date == null) { return null; }// w ww .ja v a 2s . com return new SimpleDateFormat(monthFormat).format(date); } public static String format(Date date, String format) { if (date == null) { return null; } return new SimpleDateFormat(format).format(date); } }