Java tutorial
//package com.java2s; import java.util.Calendar; import java.util.Date; public class Main { public static Date getFirstDate(Date date) { Calendar calendar = Calendar.getInstance(); calendar.setTime(date); calendar.set(Calendar.DATE, 1); return calendar.getTime(); } }