Here you can find the source of getMonth(Date d)
public static Date[] getMonth(Date d)
//package com.java2s; import java.util.Calendar; import java.util.Date; public class Main { public static Date[] getMonth(Date d) { Date[] dS = new Date[2]; Calendar calendar = Calendar.getInstance(); calendar.setTime(d);// w w w. ja v a2s. co m calendar.set(Calendar.DAY_OF_MONTH, calendar.getActualMinimum(Calendar.DAY_OF_MONTH)); dS[0] = calendar.getTime(); calendar.set(Calendar.DAY_OF_MONTH, calendar.getActualMaximum(Calendar.DAY_OF_MONTH)); dS[1] = calendar.getTime(); return dS; } }