Here you can find the source of getFirstDayOfTheYear(int year)
public static Date getFirstDayOfTheYear(int year)
//package com.java2s; //License from project: Open Source License import java.util.Calendar; import java.util.Date; public class Main { public static Date getFirstDayOfTheYear(int year) { // get first day of the year Calendar firstDayOfThisYear = Calendar.getInstance(); firstDayOfThisYear.clear();/*from w w w .ja va 2 s . com*/ firstDayOfThisYear.set(Calendar.YEAR, year); firstDayOfThisYear.set(Calendar.DAY_OF_YEAR, 1); return firstDayOfThisYear.getTime(); } }