Here you can find the source of getYear(Date start)
public static int getYear(Date start)
//package com.java2s; //License from project: Apache License import java.util.Calendar; import java.util.Date; public class Main { public static int getYear(Date start) { Calendar c = Calendar.getInstance(); c.setTime(start);//from www.ja va 2s . co m Calendar now = Calendar.getInstance(); int count = 0; for (;;) { c.add(Calendar.YEAR, 1); count++; if (c.after(now)) { break; } } return count; } }