Here you can find the source of getDayofWeekInMonth(String year, String month, String weekOfMonth, String dayOfWeek)
public static int getDayofWeekInMonth(String year, String month, String weekOfMonth, String dayOfWeek)
//package com.java2s; //License from project: Apache License import java.util.Calendar; import java.util.GregorianCalendar; public class Main { public static int getDayofWeekInMonth(String year, String month, String weekOfMonth, String dayOfWeek) { Calendar cal = new GregorianCalendar(); int y = new Integer(year).intValue(); int m = new Integer(month).intValue(); cal.clear();/*from w w w.j av a 2s . c o m*/ cal.set(y, m - 1, 1); cal.set(Calendar.DAY_OF_WEEK_IN_MONTH, new Integer(weekOfMonth).intValue()); cal.set(Calendar.DAY_OF_WEEK, new Integer(dayOfWeek).intValue()); return cal.get(Calendar.DAY_OF_MONTH); } }