Here you can find the source of getWeekInMonth()
public static int getWeekInMonth()
//package com.java2s; //License from project: Open Source License import java.util.Calendar; public class Main { public static int getWeekInMonth() { Calendar c = Calendar.getInstance(); int week = c.get(Calendar.WEEK_OF_MONTH); return week; }//from w w w . j av a 2 s. co m }