Here you can find the source of getDayOfDate(Date date)
public static Integer getDayOfDate(Date date)
//package com.java2s; //License from project: Apache License import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static DateFormat yyyyMMddFormat = new SimpleDateFormat("yyyyMMdd"); public static Integer getDayOfDate(Date date) { return Integer.valueOf(yyyyMMddFormat.format(date)); }//from ww w .jav a 2 s. c om public static Integer getDayOfDate(Long date) { Date dt = new Date(); dt.setTime(date); return Integer.valueOf(yyyyMMddFormat.format(dt)); } }