Here you can find the source of getMinDayInMonth(java.sql.Date date)
public static Timestamp getMinDayInMonth(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 getMinDayInMonth(java.sql.Date date) { Calendar cale = Calendar.getInstance(); cale.setTime(date);//from w w w . j a va2 s. c o m cale.set(Calendar.DAY_OF_MONTH, cale.getActualMinimum(Calendar.DAY_OF_MONTH)); java.sql.Date newDate = new java.sql.Date(cale.getTimeInMillis()); cale = null; return Timestamp.valueOf(newDate.toString() + " 00:00:00.000"); } }