Java examples for java.util:Week
get Week Of First Day
//package com.java2s; import java.util.Calendar; public class Main { public static void main(String[] argv) throws Exception { int year = 2; int month = 2; System.out.println(getWeekOfFirstDay(year, month)); }// w w w . j a va 2 s.co m public static int getWeekOfFirstDay(int year, int month) { Calendar calendar = Calendar.getInstance(); calendar.set(Calendar.YEAR, year); calendar.set(Calendar.MONTH, month); calendar.set(Calendar.DAY_OF_MONTH, 1); return calendar.get(Calendar.DAY_OF_WEEK); } }