Here you can find the source of getFirstDayOfThisYear()
public static String getFirstDayOfThisYear()
//package com.java2s; //License from project: Open Source License import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; public class Main { public static final SimpleDateFormat shortDateFormat = new SimpleDateFormat("yyyy-MM-dd"); public static String getFirstDayOfThisYear() { Calendar calendar = Calendar.getInstance(); calendar.set(Calendar.MONTH, 1); calendar.set(Calendar.DAY_OF_YEAR, 1); Date date = new Date(calendar.getTimeInMillis()); return shortDateFormat.format(date); }/*from w w w .jav a2 s . c om*/ }