Here you can find the source of getMonth(java.util.Date date)
public static java.util.Date[] getMonth(java.util.Date date)
//package com.java2s; public class Main { public static java.util.Date[] getMonth(java.util.Date date) { java.util.Calendar cal = java.util.Calendar.getInstance(); cal.setTime(date);/* w ww . ja v a2 s . co m*/ int lastDay = cal.getActualMaximum(java.util.Calendar.DAY_OF_MONTH); cal.set(java.util.Calendar.DAY_OF_MONTH, 1); java.util.Date begin = cal.getTime(); cal.set(java.util.Calendar.DAY_OF_MONTH, lastDay); java.util.Date end = cal.getTime(); return new java.util.Date[] { begin, end }; } }