Here you can find the source of getDay(Date date)
Parameter | Description |
---|---|
date | a parameter |
public static int getDay(Date date)
//package com.java2s; import java.util.Calendar; import java.util.Date; public class Main { /**/*ww w . j av a 2 s .c o m*/ * Extracts the day value from the given date. * * @param date * @return */ public static int getDay(Date date) { if (date == null) { return 0; } Calendar cal = Calendar.getInstance(); cal.setTime(date); return cal.get(Calendar.DATE); } }