Java Date get Year int value
import java.util.Calendar; import java.util.Date; public class Main { public static void main(String[] argv) { Date startDate = new Date(); System.out.println(getDateOfYear(startDate)); }/*from w w w . ja va2s . co m*/ public static int getDateOfYear(Date startDate) { Calendar cc = Calendar.getInstance(); if (startDate != null) { cc.setTime(startDate); } return cc.get(Calendar.YEAR); } }