Here you can find the source of getCurrentYearBegDate(Date date)
public static Date getCurrentYearBegDate(Date date)
//package com.java2s; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static Date getCurrentYearBegDate(Date date) { try {/* ww w. j a v a2 s. c o m*/ SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); String strDate = format.format(date); String[] split = strDate.split("-"); String year = split[0]; String beginDate = year + "-" + "01" + "-" + "01"; Date parse = format.parse(beginDate); return parse; } catch (ParseException e) { e.printStackTrace(); return null; } } }