Here you can find the source of getDay(Date date)
public static int getDay(Date date)
//package com.java2s; /**//from w w w . ja v a 2s. c o m * Copyright (c) 2014 http://www.lushapp.wang * * Licensed under the Apache License, Version 2.0 (the "License"); */ import java.util.*; public class Main { public static int getDay(Date date) { return getDatePar(Calendar.DAY_OF_MONTH, date); } public static int getDatePar(int par, Date date) { Calendar calendar = Calendar.getInstance(); calendar.setTime(date); int result = calendar.get(par); switch (par) { case Calendar.MONTH: result++; } return result; } }