Java tutorial
//package com.java2s; //License from project: Apache License import java.util.Date; import java.util.Calendar; public class Main { public static int getTheMonthDayCount(Date date) { Calendar c = Calendar.getInstance(); c.setTime(date); int lastDay = c.getActualMaximum(Calendar.DAY_OF_MONTH); return lastDay; } }