Here you can find the source of getYear(Date d)
public static int getYear(Date d)
//package com.java2s; //License from project: Open Source License import java.util.Calendar; import java.util.Date; public class Main { public static int getYear(Date d) { Calendar c = Calendar.getInstance(); c.setTime(d);/*from ww w . ja va 2s . c o m*/ return c.get(Calendar.YEAR); } public static int getYear() { return getYear(new Date()); } }