Here you can find the source of getStartMonth(int year, int month)
public static Date getStartMonth(int year, int month)
//package com.java2s; //License from project: Open Source License import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; public class Main { public static Date getStartMonth(int year, int month) { Calendar calendar = Calendar.getInstance(); calendar.set(year, month, 1);// w w w. ja v a2 s .com return getStartDate(calendar.getTime()); } public static Date getStartDate(Date date) { if (date == null) { return null; } Calendar cal = Calendar.getInstance(); cal.setTime(date); cal.set(11, 0); cal.set(12, 0); cal.set(13, 0); cal.set(14, 0); return cal.getTime(); } public static String getTime(Date dt, String format) { SimpleDateFormat st = new SimpleDateFormat(format); return st.format(dt); } }