Here you can find the source of getDay(Date date)
public static Integer getDay(Date date)
//package com.java2s; //License from project: Apache License import java.sql.Date; import java.util.Calendar; import java.util.GregorianCalendar; public class Main { public static Integer getDay(Date date) { return initCalendar(date).get(Calendar.DAY_OF_MONTH); }/* w w w . j av a2 s . c o m*/ private static Calendar initCalendar(Date date) { Calendar calendar = new GregorianCalendar(); calendar.setTime(date); return calendar; } }