Here you can find the source of firstDay(Date date)
public static Date firstDay(Date date)
//package com.java2s; //License from project: Open Source License import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; public class Main { public static Date firstDay(Date date) { Calendar calendar = convert(date); calendar.set(Calendar.DATE, 1); return calendar.getTime(); }/*w w w .jav a2 s . c o m*/ private static Calendar convert(Date date) { Calendar calendar = new GregorianCalendar(); calendar.setTime(date); return calendar; } }