Here you can find the source of getYearBegin(final Date date)
public static Date getYearBegin(final Date date)
//package com.java2s; import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; public class Main { public static Date getYearBegin(final Date date) { if (date == null) { return null; }// w ww . ja v a 2 s . c o m Calendar cal = GregorianCalendar.getInstance(); cal.setTime(date); cal.set(Calendar.MONTH, 0); cal.set(Calendar.DATE, 1); return cal.getTime(); } }