Here you can find the source of getStartOfYear()
public static Date getStartOfYear() throws ParseException
//package com.java2s; //License from project: Open Source License import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; public class Main { public static Date getStartOfYear() throws ParseException { return new SimpleDateFormat("dd.MM.yyyy").parse("01.01." + Calendar.getInstance().get(Calendar.YEAR)); }// w w w .ja v a 2s . co m }