Here you can find the source of getMonthDays(java.sql.Date date)
public static java.sql.Date[] getMonthDays(java.sql.Date date)
//package com.java2s; //License from project: Apache License import java.util.Calendar; public class Main { public static java.sql.Date[] getMonthDays(java.sql.Date date) { Calendar cale = Calendar.getInstance(); cale.setTime(date);//w w w. j av a2 s.com int today = cale.get(Calendar.DAY_OF_MONTH); int days = cale.getActualMaximum(Calendar.DAY_OF_MONTH); long millis = cale.getTimeInMillis(); java.sql.Date dates[] = new java.sql.Date[days]; for (int i = 1; i <= days; i++) { long sub = (today - i) * 24 * 60 * 60 * 1000L; dates[i - 1] = new java.sql.Date(millis - sub); } cale = null; return dates; } }