Here you can find the source of startOfMonthDate(Date date)
static public Date startOfMonthDate(Date date)
//package com.java2s; //License from project: Open Source License import java.util.*; public class Main { static public Date startOfMonthDate(Date date) { Calendar now = Calendar.getInstance(); now.setTime(date);//from www . java 2s . c om now.set(Calendar.DAY_OF_MONTH, 1); now.set(Calendar.HOUR_OF_DAY, 0); now.set(Calendar.MINUTE, 0); now.set(Calendar.SECOND, 0); now.set(Calendar.MILLISECOND, 0); return now.getTime(); } }