Here you can find the source of firstDayOfMonth(Date date)
public static Date firstDayOfMonth(Date date)
//package com.java2s; //License from project: Apache License import java.util.Calendar; import java.util.Date; public class Main { public static Date firstDayOfMonth(Date date) { Calendar c = Calendar.getInstance(); c.setTime(date);/*from www .java 2 s .c o m*/ c.set(Calendar.DAY_OF_MONTH, 1); return c.getTime(); } }