Here you can find the source of getDayOfMonth(Date date)
public static int getDayOfMonth(Date date)
//package com.java2s; //License from project: Apache License import java.util.Calendar; import java.util.Date; public class Main { public static int FIRST_DAY_OF_WEEK = Calendar.MONDAY; public static int getDayOfMonth(Date date) { Calendar c = getCalendar(); c.setTime(date);/* ww w . java 2s . c o m*/ return c.getActualMaximum(Calendar.DAY_OF_MONTH); } private static Calendar getCalendar() { Calendar c = Calendar.getInstance(); c.setFirstDayOfWeek(FIRST_DAY_OF_WEEK); return c; } }