Java tutorial
//package com.java2s; import java.util.Calendar; public class Main { public static int getCurrentMonthDay() { // calendar.getActualMaximum(Calendar.DAY_OF_MONTH), Calendar a = Calendar.getInstance(); a.set(Calendar.DATE, 1); a.roll(Calendar.DATE, -1); int maxDate = a.get(Calendar.DATE); return maxDate; } }