Java tutorial
//package com.java2s; import java.util.Calendar; public class Main { private static Calendar calendar = Calendar.getInstance(); public static int getCurrentMaxNumOfMonth() { return calendar.getActualMaximum(Calendar.DAY_OF_MONTH); } }