Here you can find the source of getYearMonth(Date date)
static public int getYearMonth(Date date) throws ParseException
//package com.java2s; //License from project: Open Source License import java.text.ParseException; import java.util.Calendar; import java.util.Date; public class Main { static public int getYearMonth(Date date) throws ParseException { Calendar c = Calendar.getInstance(); c.setTime(date);/*from w w w.j a va 2 s .c o m*/ return (c.get(Calendar.YEAR)) * 100 + c.get(Calendar.MONTH) + 1; } }