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