Here you can find the source of getMonthEndDate(Date date)
public static Date getMonthEndDate(Date date)
//package com.java2s; import java.util.Calendar; import java.util.Date; public class Main { public static Date getMonthEndDate(Date date) { Calendar calendar = calendarDate(date); calendar.set(Calendar.DAY_OF_MONTH, calendar.getActualMaximum(Calendar.DAY_OF_MONTH)); Date endDate = calendar.getTime(); return endDate; }//from w w w .j a v a 2 s. c o m public static Calendar calendarDate(Date date) { Calendar calendar = Calendar.getInstance(); calendar.setTime(date); return calendar; } }