Java tutorial
//package com.java2s; import java.util.Calendar; public class Main { public static int getDayNumOfMonth(int y, int m) { Calendar calendar = Calendar.getInstance(); calendar.set(y, m - 1, 1); int dateNumber = calendar.getActualMaximum(Calendar.DATE); return dateNumber; } }