Here you can find the source of getMonthStartDay(Date date)
public static Date getMonthStartDay(Date date)
//package com.java2s; import java.util.Calendar; import java.util.Date; public class Main { public static Date getMonthStartDay(Date date) { Calendar calendar = getCalendar(date); calendar.set(Calendar.DAY_OF_MONTH, 1); return calendar.getTime(); }/*from w ww . j a v a 2 s .c o m*/ /** * @param date * @return Calendar */ public static Calendar getCalendar(Date date) { Calendar calendar = Calendar.getInstance(); calendar.setTime(date); return calendar; } }