Java tutorial
import java.util.Calendar; import java.util.Date; public class Main { public static void main(String[] argv) { System.out.println(getDay(new Date())); } public static Integer getDay(Date date) { if (date == null) return 0; Calendar cal = Calendar.getInstance(); cal.setTime(date); return cal.get(Calendar.DAY_OF_MONTH); } }