xxxxxxxxxx
Calendar c = Calendar.getInstance();
c.setTime(yourDate);
int dayOfMonth = c.get(Calendar.DAY_OF_MONTH);
xxxxxxxxxx
/*
* 'findDay' function
*
* The function is expected to return a STRING.
* The function accepts following parameters:
* 1. INTEGER month
* 2. INTEGER day
* 3. INTEGER year
*/
public static String findDay(int month, int day, int year) {
SimpleDateFormat simpleDateformat = new SimpleDateFormat("EEEE");
Date date = new GregorianCalendar(year, month - 1, day).getTime();
String dayText = simpleDateformat.format(date);
return dayText.toUpperCase();
}
xxxxxxxxxx
Calendar cal = Calendar.getInstance();
cal.set(year,month-1,day);
int nd = cal.get(Calendar.DAY_OF_WEEK);