Here you can find the source of getYearStart(Date date)
public static Date getYearStart(Date date)
//package com.java2s; import java.util.Calendar; import java.util.Date; public class Main { public static Date getYearStart(Date date) { Calendar cal = Calendar.getInstance(); cal.setTime(date);/*from w ww .j av a 2s . c o m*/ cal.set(Calendar.MONTH, Calendar.JANUARY); cal.set(Calendar.DAY_OF_MONTH, 1); cal.set(Calendar.HOUR_OF_DAY, 0); cal.set(Calendar.MINUTE, 0); cal.set(Calendar.SECOND, 0); return cal.getTime(); } }