Here you can find the source of getDayOfMonth()
public static int getDayOfMonth()
//package com.java2s; //License from project: LGPL import java.util.*; public class Main { public static int getDayOfMonth() { Calendar calendar = Calendar.getInstance(); return calendar.get(Calendar.DAY_OF_MONTH); }// w w w . j av a 2 s . co m public static int getDayOfMonth(final Date date) { Calendar calendar = Calendar.getInstance(); calendar.setTime(date); return calendar.get(Calendar.DAY_OF_MONTH); } }