Here you can find the source of monthBegin(final Date date)
public static Date monthBegin(final Date date)
//package com.java2s; //License from project: Apache License import java.util.Calendar; import java.util.Date; public class Main { public static Date monthBegin(final Date date) { Calendar c = Calendar.getInstance(); c.setTime(date);/*from w w w . j a v a2 s . co m*/ 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(); } }