Here you can find the source of getFirstDayOfMonth(Date date)
public static Date getFirstDayOfMonth(Date date)
//package com.java2s; //License from project: Apache License import java.util.*; public class Main { public static Date getFirstDayOfMonth(Date date) { Calendar calendar = Calendar.getInstance(); calendar.setTime(date);/*from w w w . j a va 2 s . com*/ calendar.set(calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH), 1); return calendar.getTime(); } }