Here you can find the source of date(Date d)
public static int date(Date d)
//package com.java2s; //License from project: Apache License import java.util.Calendar; import java.util.Date; public class Main { public static int date(Date d) { Calendar cal = Calendar.getInstance(); cal.setTime(d);// ww w .ja va 2 s . c o m return cal.get(Calendar.DATE); } }