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; 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 = Integer.valueOf(year).intValue(); int m = Integer.valueOf(month).intValue(); cal.clear();//from w w w .ja va 2s . c om cal.set(y, m - 1, 1); cal.set(Calendar.DAY_OF_WEEK_IN_MONTH, Integer.valueOf(weekOfMonth) .intValue()); cal.set(Calendar.DAY_OF_WEEK, Integer.valueOf(dayOfWeek).intValue()); return cal.get(Calendar.DAY_OF_MONTH); } }