Get the last date of a month
import java.util.Calendar; public class Main { public static void main(String[] args) { Calendar calendar = Calendar.getInstance(); int lastDate = calendar.getActualMaximum(Calendar.DATE); System.out.println("Date : " + calendar.getTime()); System.out.println("Last Date: " + lastDate); } }