Here you can find the source of getMaxDayInMonth(java.sql.Date date)
public static Timestamp getMaxDayInMonth(java.sql.Date date)
//package com.java2s; //License from project: Apache License import java.sql.Timestamp; import java.util.Calendar; public class Main { public static Timestamp getMaxDayInMonth(java.sql.Date date) { Calendar cale = Calendar.getInstance(); cale.setTime(date);/* ww w . jav a2 s . co m*/ cale.set(Calendar.DAY_OF_MONTH, cale.getActualMaximum(Calendar.DAY_OF_MONTH)); java.sql.Date newDate = new java.sql.Date(cale.getTimeInMillis()); cale = null; return Timestamp.valueOf(newDate.toString() + " 23:59:59.999"); } }