Here you can find the source of getYearMonthStr(Date parseDate)
public static String getYearMonthStr(Date parseDate)
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Date; public class Main { private static final String YYYYMMINTFORMAT = "yyyyMM"; public static String getYearMonthStr(Date parseDate) { return formatStr(parseDate, YYYYMMINTFORMAT); }//from w w w . ja v a 2 s . c o m public static String formatStr(Date date, String dateFormat) { return new SimpleDateFormat(dateFormat).format(date).toString(); } }