Here you can find the source of getMonthStart(Calendar c)
public static Date getMonthStart(Calendar c)
//package com.java2s; /* Copyright c 2005-2012. * Licensed under GNU LESSER General Public License, Version 3. * http://www.gnu.org/licenses/*from w ww . ja va 2 s.c o m*/ */ import java.util.Calendar; import java.util.Date; public class Main { public static Date getMonthStart(Calendar c) { c.set(Calendar.DAY_OF_MONTH, 1); c.set(Calendar.HOUR_OF_DAY, 0); c.set(Calendar.MINUTE, 0); c.set(Calendar.SECOND, 0); c.set(Calendar.MILLISECOND, 0); return c.getTime(); } }